Get Free Shipping on orders over $49
From Zero to Compilers : How Source Code Becomes Machine Code - Zero to the Zeroth

From Zero to Compilers

How Source Code Becomes Machine Code

By: Zero to the Zeroth

eBook | 31 October 2026

At a Glance

eBook


$15.62

or 4 interest-free payments of $3.90 with

Instant Digital Delivery to your Kobo Reader App

You press compile every day, and a few seconds later an executable appears. For most programmers, what happens in between is a black box. This book opens it and follows the pipeline that real compilers use, from the first character of source code to the instructions the processor runs.

The lexer cuts characters into tokens, using regular expressions and finite automata. The parser builds a tree, by recursive descent or with the LR family of tables that parser generators produce. The tree is refined into an abstract syntax tree, checked against scopes and a type system, and lowered to three-address code, control-flow graphs, and SSA form. Code generation then selects instructions, allocates registers, and schedules them, following real stack frames and calling conventions. Optimization gets three chapters of its own: dataflow analysis, loop optimization, and SSA-based global and interprocedural optimization. The last part leaves the classic pipeline for garbage collection, just-in-time compilation, LLVM, GCC, MLIR, and open problems such as WebAssembly, formal verification, and machine learning in compilers. Every stage starts with intuition and a small worked example, such as a subset construction, an LR automaton, or a register-coloring trace, and then adds the theory it needs, with real compiler output, LLVM IR, and x86-64 assembly along the way.

Written for programmers who have never taken a compiler course or have forgotten most of it. You should be comfortable with functions, recursion, pointers, and basic data structures, and able to read basic C; assembly language, automata, and type theory are explained as they become necessary.

Every book in the From Zero series is written for readers with no background: intuition and analogies first, math and detail only when they are needed, so a whole field becomes a path you can walk on your own.

on

More in Compilers & Interpreters

Trustworthy Compilers - Vladimir O. Safonov

eTEXT

Fast Track to MDX - Mark Whitehorn

eTEXT