Skip to main content
Zero external dependencies using only Zig standard library. Single static binary (~1-5MB optimized) with trivial cross-compilation. Requires Zig 0.15+ (uses new HTTP client and I/O APIs)

Quick Start

cd examples/polyglot/zig/
zig build -Doptimize=ReleaseFast
./zig-out/bin/synth-task-app
With authentication:
ENVIRONMENT_API_KEY=your-secret ./zig-out/bin/synth-task-app

Cross-Compilation

Zig makes cross-compilation trivial:
# Linux (static musl)
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-musl

# Linux ARM64
zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux-musl

# macOS ARM64
zig build -Doptimize=ReleaseFast -Dtarget=aarch64-macos

# Windows
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-windows

Implementation Notes

Zig requires manual HTTP request handling, but the core logic is straightforward. The implementation uses Zig’s standard library HTTP client for LLM calls.

When to Choose Zig

  • You want the smallest possible binaries
  • You need trivial cross-compilation
  • You want no garbage collection for predictable latency
  • You’re comfortable with a newer language

Full Example

zig/src/main.zig