zig

Installation
SKILL.md

Zig 0.16 for Native SDK code

The Native SDK requires Zig 0.16.0 (minimum_zig_version in build.zig.zon; the CLI pins the same version and offers a checksum-verified download into ~/.native/toolchains/ when the zig on PATH does not match). Training data and older guides teach Zig 0.15 idioms, and 0.16 moved everything that touches the outside world — files, stdout, clocks, sleeping, process spawning, sockets — behind an explicit std.Io value, while containers became allocator-per-call. Each section below is headed by the exact compile error the old idiom produces, so search this file by error text.

Two rules resolve most failures:

  • Operations on the outside world take a std.Io first (or right after the receiver). Get one from init.io in main(init: std.process.Init), from std.testing.io in tests, or from std.Io.Threaded in code with no Init to thread through.
  • Containers are unmanaged: initialize with .empty and pass the allocator to every mutating call.

In a UiApp, update never sees an Io — persistence, subprocesses, HTTP, clocks, and timers go through the typed effects channel (fx.readFile, fx.spawn, fx.fetch, fx.wallMs, fx.startTimer; see native skills get native-ui). Raw std.Io belongs in main, tests, and standalone tools. And because Zig analyzes lazily, a 0.15-ism can hide in code only one build path references: run BOTH zig build and zig build test before calling a change done.

error: struct 'heap' has no member named 'GeneralPurposeAllocator' — allocators come from main(init: std.process.Init)

Zig 0.15 and earlier:

Installs
1
GitHub Stars
7.2K
First Seen
Today
zig — vercel-labs/native