Found in 8 comments on Hacker News
joe_loser · 2017-07-29 · Original thread
The book "Engineering a Compiler" (https://www.amazon.com/Engineering-Compiler-Second-Keith-Coo...) is a good resource and reference; I keep it on my desk at work. Like other compiler books, it falls short in meeting all practical application purposes and does great with theory. Ideally, this book should be combined with looking at modern compiler implementations.
techjuice · 2017-07-07 · Original thread
The following that I have on my bookshelf have helped:

Compilers Second Edition [0]

Engineering a Compiler, Second Edition [1]

Computer Systems: A Programmer's Perspective (3rd Edition) [2]

[0]https://www.amazon.com/Compilers-Principles-Techniques-Alfre... [1]https://www.amazon.com/Engineering-Compiler-Second-Keith-Coo... [2]https://www.amazon.com/Computer-Systems-Programmers-Perspect...

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...

brettlangdon · 2016-06-21 · Original thread
Given how much of a novice I still am in the subject, might want to take my suggestions with a grain of salt compared to others.

I have always really enjoyed just reading the source code for programming languages. As I learn more and more, I seem to take away a bit more each time.

Personally I've enjoyed reading through the source code for Go, since it is hand written in Go. Being hand written, it can be a little repetition reading through it, but I find it to be pretty easier to read/understand.

https://github.com/golang/go/tree/release-branch.go1.6/src/g...

Also, I have read (at least parts of) the book, "Engineering a Compiler", which being a novice in the subject, some of it goes over my head, but I think it does a better job outlining the topic than any other books I have read.

https://www.amazon.com/Engineering-Compiler-Second-Keith-Coo...

Enjoy :)

I found this book on compilers to be rather up-to-date, clear and useful when you start going into the topic: http://www.amazon.com/Engineering-Compiler-Second-Edition-Co...
stiff · 2013-03-18 · Original thread
The single best resource on this topic is the "Dragon Book"

Your advice is great in general, but I wish people would back up statements like this with some context, for example, what specifically have you compared it with? Inspired by Steve Yegge blogposts I once decided to write a toy compiler for educational purposes and I started with reading the Dragon Book, in fact I eventually read it almost cover to cover and implemented many algorithms from it, it is definitely full of valuable information. But it also is a very roundabout way of learning how to write an actual compiler, it is more a theoretical reference work than anything else. There are several hundreds of pages devoted to parsing, but some of the more modern techniques are not covered, runtime is treated much more briefly and many practical issues are not discussed at all. There are some nice modern textbooks that are more to the point:

http://www.amazon.com/Modern-Compiler-Design-D-Grune/dp/0471... http://www.amazon.com/Engineering-Compiler-Second-Keith-Coop...

ANTLR is a great tool and many practical issues I solved with the help of this book about it:

http://www.amazon.com/gp/product/1934356999/

Finally, source code of original AWK is a great example codebase to learn about real-world parsing, building and traversing parse trees etc.:

https://github.com/danfuzz/one-true-awk

It is an interpreter and not a compiler but once you know how to do the things just mentioned converting it to a naive compiler isn't that hard if you are not interested in fancy optimization like the OP said.

itsnotvalid · 2011-02-10 · Original thread
It would be nice to learn about new compiler internals. I wonder though, how many of us would need to work day to day on a compiling language (as comparing to intercepted or JIT languages.)

BTW, why not getting that @ amazon? At least you get 20% of in the US (but only get the book by March)

(The worst plug here for my own amazon link, you are warned, please don't vote this down just for the link: http://amzn.to/fpNazO)

Fresh book recommendations delivered straight to your inbox every Thursday.