Introduction to Compilers and Language Design (2021)

305 points · 50 comments on HN · read original →

Points and comments are a snapshot, not live.

Free textbook guides building a C-like compiler targeting X86 or ARM assembly.

Prof. Douglas Thain at Notre Dame offers a free textbook for a one-semester compiler course. It covers scanning, parsing, semantic analysis, code generation, and optimization for X86/ARM. The 2nd edition provides PDFs of each chapter plus a complete book download. A GitHub repo includes example code, starter projects, and test cases.

What commenters are saying

Commenters praise the book as a solid undergraduate-level walkthrough of compiler construction. Some note it focuses on C-like languages and omits deeper language design topics like advanced type systems. Several users share personal experiences building compilers or transitioning into compiler engineering, noting that assembly generation is simpler than optimization. One commenter who took Thain's class highly recommends following the entire project.