Day 01 of 30 · Compiler foundations
Understand what a compiler does
- Time
- About 150 minutes: 40 reading, 80 lab, 20 testing, 10 notes.
- Prerequisites
- None. Start here.
Toolchain: LLVM 17
Use your LLVM 17 clang++, llvm-as and opt for book exercises, by explicit path. Use the matching archived documentation. Do not mix headers, libraries or plugins with your current-main build. Setup guide
Learn
- Source code, frontend, intermediate representation, optimizer, backend, assembler and linker.
Read Reading
- R1 · Learn LLVM 17, Second Edition
Chapter 2: compiler building blocks · 25 min - R3 · Crafting Interpreters
Introductory compiler overview · 15 min
Reading budgets cover selected sections, not whole chapters. Link to the book; this site does not reproduce it.
Build Build or investigate
- Use the pipeline commands in the setup section on a five-line C++ function.
- Save preprocessed source, LLVM IR, assembly and an object file.
- Write one sentence explaining each output.
Done when
A pipeline note and four output files; distinguish compiling from linking.
Recall question
Why can the same frontend support more than one processor?
Optional
- Inspect the driver commands with
clang++ -###.
Optional work never counts toward completion.
Completion checks
Progress tracking needs JavaScript. The lesson above is complete without it.
Notes
Saved only in this browser. Keep it short enough to finish in ten minutes; none of the prompts are required. All notes, export and import