flâneur — a map of the web's best reading

Building a Performant Compiler from Scratch — Bowen Cheng

bowencheng.dev · 2,907 words · saved by 1 readers

Architecture, algorithms, and optimization techniques behind a 10k+ line compiler pipeline that lowers a C-like language to x86-64.

Introduction I built a compiler that translates a C-like language called LB all the way down to x86-64 assembly, producing executables that can run directly on modern processors. The system consists of more than 10,000 lines of code and implements many of the classic components of a modern compiler, including instruction selection, register allocation, data-flow analysis, and multiple optimization passes. Rather than implementing a single monolithic compiler, the system is structured as a pipeline of compilers. A program begins in the LB language and is successively translated through a sequen

Explore this link on the map →

related reading