Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

After reading this post when it came out, I started learning about compilers. I bought the dragon book from AbeBooks.com (which cost just $3.50 there; Amazon = $85) and I am reading it now.

I found 'Incremental Approach To Compiler Construction' [pdf] (http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf) to be really great.

Anybody else here learning compiler construction? Any suggestions?



Engineering a Compiler by Cooper and Torczon is probably better these days than the dragon book. The dragon book is of primarily historical interest imo. (Unless you really do need to write an LL(k) parser generator...)

I would say coding is more important than studying the books a lot.


A new 2nd edition of the Dragon Book just came out last summer. Is that one still only of historical interest?


I don't know, I haven't looked at it. But you won't go wrong with Cooper & Torczon.


This is curious. I haven't studied compilers at all, but I always hear the Dragon book is the default. Can anyone second these recommendations (Cooper/Torczon, the Gholoum paper)?


Thanks.

Is "Engineering a Compiler by Cooper and Torczon" good for actually coding a compiler?


No, no book is good for that. You just need to pick a project and start coding. Interpreters are a fun place to begin. I'd suggest getting a parser generator and reimplementing Lua or something. You'll want to look up stuff in the Cooper & Torczon book as you do this (like what an abstract syntax tree is), but I doubt it's useful to read it through or study it. Reading the code of existing compilers is also very helpful. (A word to the wise: Don't start with the source code of GCC or other industrial-strength compiler. :))

(This is my philosophy toward learning anything programming related, so maybe I'm just weird.)


Thanks a lot.


I found source code of IronPython very easy to understand and modify. Check it out, it's written in clean C#.


You're probably beyond this, but just in case I'd recommend being 100% comfortable with everything in this book before moving on to the dragon book.

The Practice of Programming: http://cm.bell-labs.com/cm/cs/tpop/toc.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: