Zig

title
Zig
type
entity
summary
Andrew Kelley's systems language; manual memory via arenas and allocators, no hidden allocations, comptime as the type-system programming mechanism
tags
language, systems-programming
created
2026-04-30
updated
2026-07-29

Zig is a systems programming language created by Andrew Kelley, intended as a replacement for C with explicit memory management, no hidden control flow, and a single mechanism β€” comptime β€” covering generics, typeclasses, and metaprogramming.

Design choices that come up repeatedly

No hidden allocations. Functions that allocate take an Allocator parameter explicitly. This is enforced by convention and by the standard library shape β€” there is no global heap to reach into. Encourages arena allocation patterns where ownership of a region of memory is the unit of management, not individual objects.

No spooky action at a distance. No operator overloading, no destructors that run implicitly (use defer to make cleanup syntactically visible), no implicit typeclass dispatch. The language refuses to insert behavior the reader can't see at the call site. See mean-free-path-language for the design framework this slots into.

Comptime over macros and templates. The same language runs at compile time as at runtime. Generics are comptime functions on types. Typeclasses are comptime functions that return a dictionary struct. There is no separate macro language.

IO as an interface. Zig 0.16 (April 2026) reworked the standard library so IO is an interface passed in via init.io, alongside the allocator. The author of zig-functional-programmers reads this as a Reader-monad shape arrived at independently β€” explicit effect carriers instead of a global runtime.

Anti-LLM contributor policy

Zig has one of the strictest LLM-contribution bans in major open source: no LLM-authored issues, PRs, or bug-tracker comments, including translation. The rationale is that maintainer review time is investment in growing trustworthy contributors β€” see contributor-poker β€” and LLM-authored PRs receive that investment without producing the long-run benefit. Even native-language posts are preferred to LLM-translated ones. The visible cost is that Bun's 4Γ— compile-speed Zig fork won't be upstreamed.

Coverage in the wiki

  • zig-functional-programmers β€” A Haskeller evaluates Zig on three axes (domain expressiveness, type-system programmability, mean-free path) and finds it scores well on all three.
  • simonw-zig-anti-ai β€” Simon Willison's coverage of Zig's anti-LLM policy and the Bun fork situation
  • contributor-poker β€” Loris Cro's framing of why the policy is structurally about contributor growth, not code quality
  • signed-vs-unsigned-sizes β€” Zig kept C's unsigned-usize convention; the C3 retrospective groups it with C/C++/Rust as having made the same mistake
  • returning-to-zig β€” someone who left Zig for Rust around 2021 and came back in 2026; first-hand read on the package manager, 0.17's build-system churn, and the ReleaseSafe safety model. The reason given for leaving Rust is governance, not language design, which makes it a useful counterweight to the policy pages above
  • zig-incremental-compilation β€” 50–70ms rebuilds from per-file ZIR caching, an analysis-unit dependency graph and an incremental linker; also the clearest statement of which language-design decisions were adjusted to keep semantic analysis tractable
  • everyone-should-know-simd β€” Mitchell Hashimoto's five-step shape for everyday SIMD, worked in Zig's generic vector builtins (@Vector, @splat, @reduce); they remove the CPU-specific syntax without removing the CPU-specific codegen
  • moonstone β€” a Lua environment and package manager written in Zig, one of the tools built on it
  • whetuu β€” a zero-config shell status line and history picker, leaning on std.Io tasks to run its slowest probe alongside the rest and keep a render near 2 ms
  • allyourcodebase β€” a GitHub org packaging C and C++ projects for the Zig build system, betting that Zig replaces make, CMake, clang and Docker with one dependency
  • tools-matter β€” Manganin, a git forge written in Zig whose pitch is a vouch-tree permission model rather than a GitHub-shaped feature set
  • gingerbill-blog β€” Ginger Bill (Odin creator), an adjacent opinionated-defaults systems-language voice
  • kelley-dont-take-the-black-pill β€” Kelley's 2026 conference talk, almost none of it about Zig: software quality tracked programmer bargaining power, and losing that is why things got worse
Sub-pages