The Wolf Book

The language text. Every sample in it was executed by CI.

Read the book. It is set to look like a printed page: white ground, one measure, no chrome.

Download the PDF · 5.9 MB — the typst-set print edition, rendered from the same pinned source as the pages here, for reading offline.

Thirty-one of the thirty-three chapters are written through, and every chapter that holds something back says so on its own page. Chapter 29 is reserved whole: its virtual machine needs a Pool constructor the compiler will not lower and a field write through a handle the interpreter declines. Chapter 25 is one section in — §25.3 teaches wolf publish and the record it writes — while §25.1 and §25.2 wait on an edition mechanism and a standard library on the page. Chapter 21 is written but reserves two of its five sections for benchmark claims not yet legally won.

The parts

Foundations (1–6)
Hello, wolf. Strings, honestly. Values and expressions. Functions. Collections and generics. Errors are values.
Memory (7–9)
Who owns this. Regions, and memory in the shape you meant. The escape hatch as a door. Chapter 7 draws its ownership trees before and after a move, a copy and a re-initialization, and no drawing is made by hand: each is generated from the interpreter's own record of every place, statement by statement, for the program beside it.
Concurrency (10–17)
Spawning is a scope. Scopes as values. Channels and select. Procs as the unit of failure. Link, monitor, supervision. Region transfer. A failing schedule, replayed.
Systems (18–25, and 33)
Comptime, one tier and no macros. Perf contracts. Modules and the shape of a project. Packages. The covenant against build scripts. The serving loop, which is the newest chapter and reads last in this part with a number out of order: section numbers are the page anchors, so a late chapter takes the next free one rather than move everything after it.
Projects (26–32)
Six programs written twice, and a coda about the allocator you never needed.

The back matter carries a grammar summary, the trap vocabulary, the diagnostic catalogue, a specification cross-reference, the driver's whole command surface, solutions to every printed exercise, a glossary, an index and an errata page. Section numbers are the page anchors, so /book/ch08.html#8.4 is a stable link.

Stable means the number keeps pointing at a page, not that it keeps pointing at the same subject. /book/ch05.html#5.5 is the case in point: it was the trait section and is the struct section now, with traits at #5.6, because chapter 5 was rearranged to put the struct before the trait that operates on it. Nothing 404s, which is exactly why it is worth saying — an old link to §5.5 still resolves and still renders, and quietly shows you something else. If you bookmarked the traits section of chapter 5 while §5.5 still meant it, the bookmark you want is #5.6. Chapter 7 gained #7.8 in the same rearrangement, which takes a free number and moves nothing.

How its claims are held

No code appears in the book that CI did not execute. Samples are extracted from the prose and run; console blocks are replayed against the pinned tools and compared byte for byte; a claim about undefined behavior has to be reproduced by both implementations before it can be printed, because one implementation alone is not evidence. A verification lane checks the softer things too: corpus counts, chapter numbering against the table of contents, clause tags, diagnostic codes, and whether every printed exercise has a published solution.

The book is written against a toolchain pin, recorded in the repository. Where the toolchain and the book disagree, the book waits.

Licensing

The code samples are GPL-3.0-or-later with the runtime exception, matching the runtime library, so code you take from the book into your own programs is yours. The license for the prose is proposed as CC BY 4.0 and is not settled; the repository is the authority for both.