Header BackgroundHeader BackgroundHeader BackgroundHeader BackgroundSebastian

Choosing the Tech Stack

The choice of technology was a process of weighing comfort against control. Having successfully built StayAwake with C and Zig, the decision to reuse this stack was straightforward. The proven combination offers direct OS interaction with minimal overhead.

Why C Again?

C provides:

  • Direct Win32 API access: No wrappers, no abstractions, just the operating system’s contracts
  • Minimal runtime: The smallest possible memory footprint
  • Predictable behavior: No garbage collector, no scheduler, no surprises
  • Binary size: A compact executable that can be embedded anywhere

Why Zig Again?

Zig serves as a powerful replacement for complex build systems:

  • Cross-compilation: Building Windows binaries from any platform
  • Modern tooling: zig build provides a clean, declarative build process
  • No dependencies: The build tool itself is self-contained
  • Optimization: Built-in support for LTO, strip, and other release optimizations

The Result: A Familiar Foundation

This combination proved ideal for WslDock:

  • Proven patterns: The event loop, tray icon, and config management from StayAwake could be adapted
  • Consistent tooling: Same build system, same formatting rules, same project structure
  • Reduced learning curve: Focus on the WSL-specific logic rather than language fundamentals

Reusing a proven tech stack is not laziness—it’s pragmatism. The C + Zig combination has already demonstrated its effectiveness for system utilities. By building on this foundation, the focus shifts to what truly matters: the WSL-specific logic and the SSH tunnel management.

AI Insights: Building on Proven Foundations