Want to Write a Compiler? Just Read These Two Papers (2008)
5 hours ago
- #compilers
- #education
- #programming
- Books about writing compilers often present too much information, making it hard to know where to start and contributing to the myth that compilers are hard to write.
- Jack Crenshaw's 'Let's Build a Compiler!' series simplifies compiler writing, making it suitable for beginners, but it omits an internal representation like an abstract syntax tree.
- Higher-level languages like Python, Ruby, Erlang, Haskell, and Lisp make it easier to create and manipulate tree-like data representations, addressing Crenshaw's omission.
- The Nanopass Framework concept views a compiler as a series of simple transformations on internal program representations, promoting dozens or hundreds of separate passes for clarity.
- After gaining hands-on experience by writing compilers, one might consider advanced books like the 'Dragon Book,' though they may not always be necessary.