TT Lab
Get started
Learn Learning paths Courses

Compilers — Build a Small Language from Start to Finish

From the lexer to x86-64, build a small language yourself

고급 · Lessons 30 · Lab 10

Start the lab

Curriculum

What a Compiler Does — Translate First, or Run Right Away

The Lexer — Characters to Tokens, Positions All the Way

The Parser — Recursive Descent, Pratt, and Error Recovery

Semantic Analysis — Scopes, Name Resolution, and Types Where Known

A Tree-Walking Interpreter — Environments and Closures

Bytecode and a Stack VM — Constant Pool, Slots, Jump Patching

Intermediate Representation and Optimization — Constant Folding, CFGs, Dominators and SSA

x86-64 Code Generation — Calling Convention and Stack Frames

Register Allocation and Garbage Collection — Linear Scan and Mark-Sweep

Reading Real Compilers — Counting gcc and clang Output

Reference docs