Introduction to Compilers and Language Design (2021)(dthain.github.io)
304 points by AlexeyBrin 1 day ago | 50 comments
tl;dr: A free online textbook by Prof. Douglas Thain (Notre Dame) covering a one-semester introduction to compiler construction, guiding readers through building a compiler that translates a C-like language into X86 or ARM assembly. Chapters cover scanning, parsing, AST construction, semantic analysis, IR, code generation, and optimization, with accompanying GitHub code examples. Targeted at undergraduates with C programming, data structures, and computer architecture backgrounds; hardcover and paperback versions are also available.
HN Discussion:
  • Personal endorsement of the author's course and the textbook's project-based approach
  • Recommends alternative resources like Crafting Interpreters or C4 for learning compilers
  • Found the book practically useful for their own DSL/compiler projects
  • Criticism that the book focuses narrowly on C and lacks language design topics
  • Appreciation for substantive technical content amid AI-focused noise