News for hackers. Stuff that matters.
Re:Ask YC: Good compiler books? by mk on Friday March 14, 2008 @12:38PM (#136886)
the dragon book.
Re:Ask YC: Good compiler books? by brooksbp on Friday March 14, 2008 @12:41PM (#136888)
Can you please elaborate? Link?

I'm really interested in Python, Ruby, JavaScript... Not looking to write a massive, enterprise-scale compiler/interpreter/parser/whatever in C, C++, or Java... possibly Java... but you get the point...

I've been checking out projects like Mozilla Rhino, Pypy, and keeping up to date with ECMAScript 4 progress... just want a solid book or two or more... :)

Re:Ask YC: Good compiler books? by mk on Friday March 14, 2008 @12:50PM (#136894)
This is what is commonly refered to as "the dragon book". http://en.wikipedia.org/wiki/Compilers:_Principles,_Techniqu...

But that may be too massive for what you are looking for. I found that Crockfords essay http://javascript.crockford.com/tdop/tdop.html really helps if you know javascript. And reading something like tinypy http://www.philhassey.com/blog/2008/02/28/tinypy-10-mit-lice... may help.

Also not necessarily a compiler book, but The Little Schemer does have you building a basic scheme interpreter at the end of the book.

Re:Ask YC: Good compiler books? by apathy on Friday March 14, 2008 @12:50PM (#136893)
The dragon book is Aho, Sethi, & Ullman. If you look through modern string search algorithm implementation, for example, the number of hits for Aho is up there with Knuth. Not that string searching has an awful lot to do with compilation, more lexing and parsing, but still. Aho and Ullman are pillars and the book is sort of the bible.

http://en.wikipedia.org/wiki/Compilers:_Principles,_Techniqu...

It's been updated to cover parallelization and other topics that were considered specialties when it was originally written. I have an older copy and am now wondering whether it mightn't be fun to trade up. We'll see.

Have you played with ANTLR? That's a neat tool. The Ragel state machine compiler is a fun toy, as well.

Re:Ask YC: Good compiler books? by dfranke on Friday March 14, 2008 @03:07PM (#137066)
I second that recommendation, with a preemptive shush to anyone was about to whine that it spends so much time covering parser generators. Those algorithms may be old hat, but they're nonetheless enlightening once you understand why they work.

I do wish they covered optimization in more depth, though.

Re:Ask YC: Good compiler books? by jey on Saturday March 15, 2008 @05:26PM (#137722)
Cooper & Torczon does cover scanners and parsers.
Re:Ask YC: Good compiler books? by huhtenberg on Friday March 14, 2008 @04:19PM (#137134)
I second this. It was (and still is) a book almost all instructors swore by back when I was in the Uni. Even though the version had a green cover and had no dragon on it :)