3 ms·
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 =
by kirubakaran 19y ago
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 http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf) to be really great.
Anybody else here learning compiler construction? Any suggestions?
- jey 19y agoEngineering 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.
- kirubakaran 19y agoThanks. Is "Engineering a Compiler by Cooper and Torczon" good for actually coding a compiler?
- jey 19y agoNo, 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.)
- kirubakaran 19y agoThanks a lot.
- tx 19y agoI found source code of IronPython very easy to understand and modify. Check it out, it's written in clean C#.
- pchristensen 19y agoThis 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)?
- mhartl 19y agoA new 2nd edition of the Dragon Book just came out last summer. Is that one still only of historical interest?
- jey 19y agoI don't know, I haven't looked at it. But you won't go wrong with Cooper & Torczon.
- bayareaguy 19y agoYou'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 http://cm.bell-labs.com/cm/cs/tpop/toc.html