Most compiler books start with a lexer, and nothing runs for chapters. This one starts with twelve bytes of machine code.
In the first hour you encode an x86-64 program by hand, wrap it in an ELF executable by hand, and run it. No assembler and no linker touches it. Then you climb, one layer per unit, until you have a complete compiler for a language called Slate: an assembler, relocatable object files the system linker accepts, a machine IR, two register allocators, SSA, an optimiser, a lexer, a parser, a type checker, a one-command driver, and DWARF line tables that let `gdb` step through Slate source one line at a time.
The order is the point. Because the back end comes first, every stage you write later has a real machine underneath it, and when the front end arrives in Unit 13 it already has somewhere to send its output.
This book was created through a process that combines careful human planning, content direction, and advanced AI technology, followed by thorough refinement and review to ensure a high-quality final work.
**Nothing is taken on trust.** The byte counts, addresses, sizes and exit statuses in the book come from running the code, and a five-layer verification suite stands behind them: hand-written encodings assembled independently by `nasm`, nearly every transcript re-executed, every "break it and watch it fail" experiment actually performed, every listing compared byte for byte with the file it came from, and random-program oracles that compile what nobody wrote. The repository's fault log lists 171 real mistakes found while the book was written, and what caught each one.
The last unit is the proof. A 270-line ray tracer is written twice, in Slate and in C. Your compiler builds one, `gcc` builds the other, and forty-one scenes must come out identical: the same picture to the byte, and the floating-point numbers behind every pixel the same to the bit.
What you get
- 19 units in five parts, more than 400 pages laid out for the screen
- More than 130 code listings, each with its real file path and line numbers, and more than 200 terminal transcripts
- About 22,000 lines of C++23 you can build, run and break, with the verification suite that checks them
- Linux on x86-64 and the usual toolchain (g++ 13+, nasm, binutils, gdb); no framework, no package manager, no dependencies