Type a branch, a subject or a topic — “round robin”, “paging”, “civil”.

Compiler Design

A compiler is a pipeline of transformations, and each one has a shape you can draw. These topics take a single expression and carry it through every phase.

Start from the beginning →

13 topics you can watch now, 11 still to come.

Foundations

What a compiler is, what it is not, and everything else that runs before your program does.

  • Bootstrapping and cross-compilers

The pipeline

The whole journey first, so every later phase has somewhere to sit.

  • Front end vs back end in depth
  • Passes and pass structure

Lexical analysis

Turning a stream of characters into a stream of words.

  • Regex to DFA for scanning

Parsing

Discovering the structure that the grammar says must be there.

  • LR(0) item sets
  • SLR, LALR and CLR

Semantic analysis

Checking the things a grammar cannot express, like types.

  • Syntax-directed translation
  • Attribute grammars

Intermediate code

A representation simple enough to optimise and easy to emit from.

  • DAG representation of a block

Optimisation and generation

Making it smaller and faster, then making it real instructions.

  • Loop optimisation
  • Instruction selection
Dashed entries are mapped but not animated yet. The running order is not fixed until a topic is built. Browse the other subjects.