RC RANDOM CHAOS

Notre Dame's Free Compiler Textbook Walks You from C-Like Syntax to X86 Assembly

· via Hacker News

Original source

Introduction to Compilers and Language Design (2021)

Hacker News →

Douglas Thain, a professor at the University of Notre Dame, offers his compiler-construction textbook as a free set of chapter PDFs, with optional hardcover and paperback editions for those who want a physical copy. Built around the university’s CSE 40243 course, the book guides a reader through a single semester of building a working compiler from scratch — one that accepts a C-like language and emits real X86 or ARM assembly. It targets undergraduates who already know some C and have background in data structures and computer architecture.

The project spans the classic compiler pipeline: scanning, parsing, type checking, and code generation. A companion GitHub repository (compilerbook-examples) supplies scanners, parsers, starter code for the project compiler, and stage-by-stage test cases, making the book usable as a hands-on lab rather than just a reference. The author permits personal and academic use but prohibits commercial redistribution, asking instructors to link to compilerbook.org so students always get the current edition.

The significance is less about novel research than about accessible pedagogy. Writing a compiler remains one of the more instructive rite-of-passage projects in computer science, tying together theory and low-level systems work, and a maintained, freely available text with runnable examples lowers the barrier for self-learners and course instructors alike.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.