r/ProgrammingLanguages • u/JanBitesTheDust • Sep 04 '22
Discussion Book recommendations after reading “crafting interpreters”
Hello, I finished the book crafting interpreters by Robert Nystrom. The book has helped me alot and felt like an amazing introduction to the field of language design and implementation.
My question however is: what next to read? I know of the dragon book and have read the first couple of chapters. But maybe there are better alternatives. Also, after crafting interpreters, i have a basic understanding of interpreted language design. However, I have the urge to study compiler design.
So are there any books you would recommend me for my level of knowledge?
View all comments
2
u/mttd Sep 06 '22
From the previous discussions:
Compilers Books
I'd indeed start with "Engineering a Compiler" by Keith Cooper and Linda Torczon. I also like "Modern Compiler Design" by Dick Grune, Kees van Reeuwijk, Henri E. Bal, Ceriel J.H. Jacobs, and Koen G. Langendoen (https://dickgrune.com/Books/MCD_2nd_Edition/). Some chapters are better in one than the other, so you may read some of both to see if you like another explanation.
For more on the analysis & compiler optimization side, "SSA-based Compiler Design" is a good follow-up (original URL (inactive): http://ssabook.gforge.inria.fr/latest/; GitHub Mirror: https://github.com/pfalcon/ssabook, PDF: https://pfalcon.github.io/ssabook/latest/; to be published in 2022: https://link.springer.com/book/9783030805142).
Further readings: Book recommendations in https://github.com/MattPD/cpplinks/blob/master/compilers.md#books as well as program analysis resources (in particular lattice theory, type systems and programming languages theory, related notation): https://gist.github.com/MattPD/00573ee14bf85ccac6bed3c0678ddbef#program-analysis-resources
If you're interested in computer architecture background (relevant for the back-end optimizations), see computer architecture books & computer architecture courses. Personally I'd definitely recommend Prof. Onur Mutlu's Lecture Videos and Materials - http://people.inf.ethz.ch/omutlu/lecture-videos.html - fantastic lecturer and more up-to-date than textbooks (e.g., branch prediction lectures discussed modern TAGE and neural network predictors a few years before they've been implemented in, say, https://en.wikichip.org/wiki/amd/microarchitectures/zen_2#Branch_Prediction_Unit; in contrast, most textbooks stop at the level of two-level / saturating bits BPs from the early 1990s).
The CS 6120 course (see below) blog is a great resource for writeups on techniques and papers: https://www.cs.cornell.edu/courses/cs6120/2020fa/blog/
Compilers Courses
I can recommend the following: https://github.com/MattPD/cpplinks/blob/master/compilers.md#courses
Particularly (in alphabetical order--I think these are all great, so including highlights of what I've liked about them):