Writing criteria for this guide
Every "for Mere Mortals" guide is written to the same nine-point standard, so a reader who trusts one can trust the rest. Here it is, with the verification notes for this particular guide below.
- Fix it first. Reader outcomes lead, not action items: each chapter opens by naming the outcome it delivers, shows a check the reader can run to confirm they got it, and a reasonable reader finishes able to state what was done, what it means, and what to try next.
- Plain language. Short sentences, everyday vocabulary, technical terms defined on first use. No slang, and no idioms that only make sense in one country — the reader may be translating as they go.
- No dead ends. A guide never tells the reader to do something it cannot show them how to verify. Every claim a reader relies on — an install, a command, an output — is something this guide demonstrates or clearly labels documented-only below.
- Live-verified where it matters. Procedures are run for real in the guide's lab wherever the build machine allows it, and the transcripts kept in the repository are the evidence. What could not be run is listed honestly below, never presented as if it had been.
- General audiences. Nothing in this guide — examples, fixtures, names, addresses — is modelled on any particular reader or author's real life, network, or organisations. The lab's examples are about making coffee, nothing more.
- Standalone. A reader needs this guide, its lab, and nothing else. Where another guide would genuinely help, it is pointed to once, by name, and the chapter still completes without it.
- Honest about limits. Chapter 14 names what the tool cannot do: a language that has not reached 1.0, builtins that vanish between releases, a small and partly mid-rearrangement standard library, safety checks that are a setting rather than a guarantee, and compile times paid in full on a small machine.
- The version is in the text, early. The README and chapter 2 state the exact release the lab ran — Zig 0.17.0 — before any procedure depends on it, because in a pre-1.0 language the version is part of every claim the guide makes, and chapter 14 shows two claims it falsified.
- Builds clean. The site builds with MkDocs in strict mode with no warnings, and a fresh reader following the chapters in order reaches the stated outcome of each.
Verification notes for this guide
The build machine is a 2-CPU, 7.7 GB Ubuntu sandbox. Zig
0.17.0 was installed from the official release tarball
(zig-x86_64-linux-0.17.0.tar.xz, fetched from
ziglang.org/download) after its SHA-256 checksum matched the
value published on the download page. The lab project is
zig-lab/kettle/; the one-purpose programs are
zig-lab/snippets/; all transcripts are
zig-lab/transcripts/.
Run for real, with transcripts as evidence:
- Install and version: checksum comparison,
zig version,zig envfields, on x86_64 (t00). zig initand the four files it creates, including the current template'sstd.process.Initmain and itsbuild.zig.zonfingerprint (t01).- Building and running the untouched template: the three
lines of output from its three voices (t02), and its
tests — silent on success, the step tree and
cachedsteps under--summary all(t03). - The guide's own replacement
mainbuilt and run throughzig build run, and a three-line program run directly withzig run(t04). - A test that fails, on purpose and labelled as such in its
own file:
expected 10, found -1, the FAIL line, the trace to the test's own line, the summary count, exit code 1 (t05). - Three compile errors in the compiler's own words: a text
value in a
u8declaration, an unused local constant, and 300 in au8(t06). - Comptime: a factorial table built in a comptime block and 20! folded at compile time (t07); and 21! asked for in a constant, refused at compile time with the exact value named (t16).
- Error sets and optionals in one running program: both
catchbranches, a found and a not-found search (t08). - A runtime integer overflow panicking in a Debug build, with trace and exit code 134 (t09).
zig cc(reporting itself as Clang 22.1.8) compiling and the lab running a C program, its output identified byfile(t10).- Cross-compiling the project to
aarch64-linux-gnuandx86_64-windows-gnu, each product identified byfileas an ARM ELF executable and a Windows PE32+ executable respectively (t11). - The optimisation flag trap, fallen into and then proven:
-Doptimize=ReleaseFaston a direct compile was accepted silently and produced a Debug-sized binary that still panicked;-O ReleaseFastproduced a binary 4,037,832 bytes against the Debug build's 10,462,008, and the overflow wrapped silently to 44 (t12). zig fmt --checkfailing a deliberately messy file with exit 1, andzig fmtrewriting it to canonical form (t13).- The removal of
@cImport, demonstrated by the canonical example failing witherror: invalid builtin function: '@cImport'(t14), and its replacement's first step,zig translate-cturning the lab's own header intopub extern fn triple(x: c_int) c_int;(t15).
Documented only — described from the project's documentation, not run, and the text does not claim otherwise:
- Installing on Windows and macOS, including the package manager routes (the lab had one Linux machine).
- Running the cross-compiled binaries: no ARM or Windows
machine was available, so chapter 12 claims only that the
builds succeed and
fileidentifies their products. - Calling a real C library from Zig through the translated module — the translation step is verified (t15); the wiring into a project build is described.
zig c++, named once in chapter 11; the lab's C was kept deliberately small.- The fuzz test the template carries: its existence is in the template source (t01); it was not fuzzed.
- The neighbours in chapter 1 and the ecosystem comparisons in chapter 14 are characterised, not benchmarked.
Fixtures are this guide's own and deliberately generic: a project named for a kettle that fills cups of coffee, a four-word shelf, and an addition that overflows because 200 + 100 does not fit in a byte. No example is modelled on any real person, project, service or organisation.