Map

Zig

Wiki entitylanguagesystems-programming โ†ณ show in map Markdown
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-05-03

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
  • moonstone โ€” a Lua environment and package manager written in Zig, one of the tools built on it
  • gingerbill-blog โ€” Ginger Bill (Odin creator), an adjacent opinionated-defaults systems-language voice
Sub-pages