Back to the bookshelf

Typographic jacket · original cover not fetched

FROM THE SHARED SHELF · 2006–2026 SAMPLE

Modern Compiler Implementation

Andrew W. Appel

4 readers recommend it across 1 discussion

Topics are model-inferred labels.

Keep it on your reading list

THE WORD OF MOUTH

What made it worth passing on?

Original Hacker News comments, in the readers’ own words.

jcl
We used Appel's book in college, and it wasn't too bad (in the hands of decent professor, of course). Appel glosses over some subjects, but you really have to if you want to implement the base compiler in a single semester and still maybe have time to implement some of the more interesting features in the second half of the book. About half our class didn't finish the base compiler. Fortunately for us, we were using the Java version of the text, so most of the students already knew the implementation language; I know a course at another school using the ML text, and none of them finished their compiler, because they had to learn the language at the same time as coding the compiler. Here's an online book that covers interpretation of programming languages in Scheme (touching on functional language compilation in several places): http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/200... (http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04-26/)
vchakrav
I would say that there are two important things to consider: 1. Understanding how a compiler works without getting bogged down by programming language details - This means that you should try and look at compilers written in Standard ML or Ocaml (my favorite), since that would be much easier to follow. For example -- a datatype can be much more succinctly expressed as type any_value = Int | String | Float rather than across 4 classes (as in the Java case). 2. Start small, and understand it in chunks. For these, a lot of web based resources are ideal. For example, to understand regular expressions, it would be nice if you were able to visualize them, and play around with them visually - http://osteele.com/archives/2006/02/reanimator I would also look at simple examples of interpreters, and build up from that, looking at examples of toy compilers: http://min-caml.sourceforge.net/index-e.html These will help, of course alongside a book like Appel's or the Dragon Book.

Also recommended in this reply

yawl
Modern Compiler Implementation by Andrew-Appel is a very good introduction book for people to get started on doing a compiler. And if you want to be more pragmatic, here is a shorter one: http://www.cl.cam.ac.uk/teaching/2004/CompConstr/NEJ/report.... (http://www.cl.cam.ac.uk/teaching/2004/CompConstr/NEJ/report.pdf) The dragon book is a MUST for compiler researcher and people who are serious on compiler, but it is hard to follow, and I do not recommend it as your first compiler book. For ruby, you can take a look of the xruby compiler I did: http://xruby.googlecode.com (google code's server has some problem now, you may have to wait for a while)

Also recommended in this reply