Cover of Modern compiler implementation in ML

Modern compiler implementation in ML

by Andrew W. Appel · first published 1997

68mentions
24recommended by
50HN commenters
2009–2024first – last mentioned

48% recommend50% neutral2% critical

Why HN recommends it

Practical, production-minded intro to compiler construction, from parsing through code generation, optimization and runtime topics like garbage collection. Preferred over the Dragon Book; ML makes the code easy to read.

Summarised by Claude from recommending comments

Affiliate links. As an Amazon Associate I earn from qualifying purchases.

Mentions per year

90 2007: 0 mentions2008: 0 mentions2009: 4 mentions2010: 2 mentions2011: 2 mentions2012: 2 mentions2013: 2 mentions2014: 0 mentions2015: 2 mentions2016: 5 mentions2017: 9 mentions2018: 6 mentions2019: 5 mentions2020: 3 mentions2021: 1 mention2022: 3 mentions2023: 3 mentions2024: 5 mentions2025: 0 mentions2026: 0 mentions200720172026

What Hacker News says

  • tmccrmck · Aug 13, 2017 · Recommends

    …21st century so many times on HN that I'm not going to comment on it's usefulness. (Search if interested) But, for those interested, I highly recommend Engineering a Compiler by Cooper and Torczon OR Modern Compiler Implementation in ML by Appel. I've read all three and would only recommend the dragon book to someone very interested in the subject.

    on “An Intro to Compilers” ↗
  • silentbicycle · Aug 26, 2011 · Recommends

    …suggest that before the Nanopass paper, really. After those, I recommend Niklaus Wirth's _Compiler Construction_ (http://www.inf.ethz.ch/personal/wirth/books/CompilerConstruc...) and Andrew Appel's _Modern Compiler Implementation in ML_ for follow-up, in that order. Wirth's book is a quick read, about on par with Crenshaw's. Appel's is more in-depth. Another comment, linking several HN compiler threads: http://news.ycombinator.com/item?id=1922002

    on “Want to Write a Compiler? Just Read These Two Papers.” ↗
  • silentbicycle · Sep 20, 2009 · Recommends

    Andrew Appel's _Modern Compiler Implementation in ML_ is probably what you want. (http://www.amazon.com/Modern-Compiler-Implementation-Andrew-...) While it uses SML, it's not hard to follow if you use OCaml, and the bibliography / references are also quite…

    on “Writing Your Own Toy Compiler Using Flex, Bison and LLVM” ↗
  • nostrademons · Nov 12, 2009 · Recommends

    The classic is the "Dragon Book": http://www.amazon.com/Compilers-Principles-Techniques-Alfred... I'm also partial to Appel's "Modern Compiler Implementation in ML", because it goes into more detail about techniques for compiling functional languages: http://www.amazon.com/Modern-Compiler-Implementation-Andrew-...

    on “Google Closure: How not to write Javascript” ↗
  • silentbicycle · Apr 27, 2010 · Recommends

    I found Appel's _Modern Compiler Implementation in ML_ to be better-suited to self study, and more modern. I've used OCaml but not SML, and didn't have any problem following it.

    on “Books Programmers Don't Really Read” ↗
  • silentbicycle · Aug 16, 2010 · Recommends

    Appel's _Modern Compiler Implementation in ML_ is a good overview. It uses SML, but I've only used OCaml and haven't had any problems following it. _Essentials of Programming Languages_ (EoPL) is a great book about writing interpreters in Scheme,…

    on “Rich Programmer Food” ↗
  • silentbicycle · Aug 29, 2010 · Recommends

    Oops, I downvoted you when I meant to upvote. There is probably another incarnation or three before the one you linked, too. I'd recommend Appel's "Modern Compiler Implementation in ML" over the dragon book.

    on “Learning to write a compiler” ↗
  • silentbicycle · Nov 12, 2010 · Recommends

    …free English translation is online at http://caml.inria.fr/pub/docs/oreilly-book/html/index.html). It covers a slightly older version of the language, but that mostly impacts libraries. Andrew Appel's _Modern Compiler Implementation in ML_ and _Compiling with Continuations_ are both great compiler books, which happen to use SML for the code. Joshua Smith's _Practical OCaml_ is bad. Really bad. I was shocked. Avoid. Chris Okasaki's _Purely…

    on “The 3 Programming Languages you need to Know” ↗
  • silentbicycle · Nov 19, 2010 · Recommends

    Yes, among others. Briefly: Read that, then Appel's _Modern Compiler Implementation in ML_, then chase whatever interests you in the bibliography and on citeseer. See also: http://news.ycombinator.com/item?id=1822515 (first) http://news.ycombinator.com/item?id=1820858 (parsing) http://news.ycombinator.com/item?id=1608752…

    on “Algorithms and Data Structures by N. Wirth [pdf]” ↗
  • silentbicycle · Jan 21, 2011 · Recommends

    …factors out some complexity - only the lexer needs to care about things like whitespace, for example. While most compiler textbooks cover lexing and parsing, I particularly recommend Andrew Appel's _Modern Compiler Implementation in ML_ and Niklaus Wirth's _Compiler Construction_ (free online, http://www-old.oberon.ethz.ch/WirthPubl/CBEAll.pdf). More recommendations on learning parsing here: http://news.ycombinator.com/item?id=1820858

    on “Efficiency of regular expressions” ↗
  • silentbicycle · Aug 4, 2011 · Recommends

    …can also get better compiler texts, these days. I recommend starting with Niklaus Wirth's _Compiler Construction_ (http://www.inf.ethz.ch/personal/wirth/books/CompilerConstruc...), then Andrew Appel's _Modern Compiler Implementation in ML_. I have a comment linking together several threads of compiler-related advice on HN here: http://news.ycombinator.com/item?id=1922002.

  • spacemanaki · Apr 11, 2012 · Recommends

    …you looking for an alternative to emitting C or to using C as the implementation language of the compiler? I'm not totally sure what you're after, and I'm a compiler noob, but I've been enjoying Appel's Modern Compiler Implementation in ML, which uses SML as the implementation language and emits RISC machine code or assembly (I think, I haven't actually gotten that far). I don't know how suitable it would be as a stepping stone to forking…

    on “PHP Sucks But I Like It” ↗
  • sklogic · Dec 14, 2015 · Recommends

    Not sure if there are any books around LLVM or gcc, but there is a lot of up to date texts. Grune at al., "Modern Compiler Design", Appel, "Modern Compiler Implementation in ML", and many more. P.S. Because of a slow-ban, adding another one to this answer. This is the best source on SSA: http://www.cri.ensmp.fr/people/pop/papers/2006-12-thesis.pdf

    on “How I wrote a self-hosting C compiler in 40 days” ↗
  • bronxbomber92 · Oct 17, 2016 · Recommends

    My three favorite books on compilers (in no particular order) are: * Engineering a Compiler: https://www.amazon.com/Engineering-Compiler-Second-Keith-Coo... * Modern Compiler Implementation in ML: https://www.cs.princeton.edu/~appel/modern/ml/ * Compiling with Continuations: https://www.amazon.com/Compiling-Continuations-Andrew-W-Appe...

    on “Programming books you might want to consider reading” ↗
  • mhh__ · Apr 21, 2017 · Recommends

    Appel's Modern compiler implementation in ML is really good, as both an introduction to compilers and some detail on implementing the runtime i.e. garbage collection. There are versions for C and Java, but ML is much easier to read in a book. If…

    on “Resources on creating programming languages” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help