Zig Guide Live
A tutorial for the Zig programming language where every snippet is compiled and executed against current Zig master on every build. If an example on this site were out of date, the build would be red.
Snippets run in your browser as WebAssembly: the very same artifact CI verified. No server, nothing to install.
Zig moves fast, and documentation that is merely proofread rots quietly. This one is re-verified against a fresh compiler nightly, and republishes itself only when every snippet still passes. The exact mechanism, including what happens to the snippets a browser cannot run, is written up in how this guide is verified. Already on a tagged release? See what changed.
Read the guide → or pick a reading path.
What is in it
210 chapters in four tracks, in one reading order. The arrows at the foot of every page follow that order, so the whole guide is one walk if you want it to be.
- FoundationsThe language and the library it ships with. Start here.
- GroundworkWhat the machine is doing, from zero. No C and no prior systems work assumed.
- SystemsZig against the world outside the process: networks, builds, C, wasm, and pixels.
- CookbookTask-shaped recipes, each a complete program CI compiled and ran.
- From ScratchRebuild the tools you use every day, one program at a time, using nothing you did not write.
- ProjectsOne library at a time, designed in the open, one decision per chapter.
What your browser needs
Running a snippet needs WebAssembly and JavaScript, and nothing else. The scripts here are built for Chrome and Edge 111, Firefox 114, and Safari 16.4 (iOS and iPadOS 16.4) or newer. On anything older, or with JavaScript off, every chapter still reads normally and every snippet is on the page, highlighted and complete; only the Run button is missing.
- Pressing Run downloads one
.wasmfile, about 70 KB for a typical snippet and 157 KB for the largest. The page keeps the compiled module, so running the same snippet again fetches nothing. - The four chapters that teach vectors are compiled with WebAssembly SIMD, because without it the vector code would quietly compile out. Firefox turns wasm SIMD off on x86 processors without SSE4.1, whatever its version, so those four can fail to load on a machine where every other snippet runs. The playground names the missing requirement instead of showing the raw engine error.
- Editing a snippet loads a code editor on first use, around 500 KB. Reading and running never load it.
- Nothing is installed and nothing runs on a server. A snippet executes in the page's sandbox with no filesystem, no network and no input, which is why a handful of examples say they were compiled by CI but cannot run here.
Who writes it
Rajesh Pillai, by hand. It is an unofficial community guide and is not affiliated with the Zig Software Foundation, whose documentation is at ziglang.org. More on what this is and what it is not, and how to report an error in a chapter.