Simone Campanoni

Associate professor
Department of Computer Science at Northwestern University

Simone Campanoni

Computer Science
Northwestern University

CS 322: Compiler Construction


The compiler is the programmer's primary tool. Understanding the compiler is therefore critical for programmers, even if they never build one. Furthermore, many design techniques that emerged in the context of compilers are useful for a range of other application areas. This course introduces students to the essential elements of building a compiler: parsing, context-sensitive property checking, code linearization, register allocation, etc. To take this course, students are expected to already understand how programming languages behave, to a fairly detailed degree. The material in the course builds on that knowledge via a series of semantics preserving transformations that start with a fairly high-level programming language and culminate in machine code.

Department page


This class takes materials from two different books (listed in the syllabus) as well as a few research papers. The result is a set of slides, notes, and code. Some lectures rely on code and notes (not slides).
All the slides used in the 2022-2023 class are below. The rest of the material is available only on Canvas.
Materials are improved every year. They are updated on this website (atomically) only at the end of the class.

Week number First lecture Second lecture
Week 0 Welcome,
Week 1 From L1 to x86_64,
Liveness analysis
Week 2 Panels about Homework #0
(L1 compiler)
Interference graph, Spilling,
Graph coloring
Week 3 Panels about Homework #1 (Liveness),
Advanced graph coloring
An alternative register allocator: puzzle solving
Week 4 Panels about Homework #2
(Interference graph and spiller)
L3 and instruction selection
Week 5 Panels about Homework #3
(L2 compiler)
Back-end missing pieces
Week 6 Panels about Homework #4
(L3 compiler)
Week 7 Panels about Homework #5 (IR compiler),
The Time-Squeezer research compiler
Competition rules
Week 8 Panels about Homework #6
(LA compiler)
Week 9 Panels about Homework #7
(LB compiler)

Hall of Fame

Students design and build a complete compiler able to translate an almost-C language to Intel x86-64 machine code. At the end of the class, the resulting compilers compete and the names of the students that designed and built the best compilers are reported below.

Year Name Picture
2022 - 2023 Julio Wang Hall of fame 2023
2021 - 2022 Riley "a11ce" Boksenbaum Hall of fame 2022
2020 - 2021 Peter Zhong and
Max Paik
Hall of fame 2021
2019 - 2020 Shu-Hung You Hall of fame 2020
2018 - 2019 Vijay Kandiah and
Chenqi Guo
Hall of fame 2019
2017 - 2018 Matt C. Cheung Hall of fame 2018
2016 - 2017 Zhiping Xiu Hall of fame 2017

External links:
LinkedIn profile LinkedIn Follow SimoneCampanoni on Twitter Twitter GitHub profile GitHub

Share this page with: