News for hackers. Stuff that matters.
Re:Books Programmers Don't Really Read by pmjordan on Tuesday April 27, 2010 @06:31AM (#1297784)
I notice that Language Implementation Patterns was written by the Author of ANTLR. I've had terrible experiences trying to use ANTLR in practice, which kind of puts me off buying the book. Do examples in the book use ANTLR? Also, is there much point in getting the book if I already know about lexer and parser generators?
Re:Books Programmers Don't Really Read by plinkplonk on Tuesday April 27, 2010 @09:38AM (#1298181)
"Do examples in the book use ANTLR?"

Yes. The book is "saturated" with ANTLR. I wouldn't buy it if you don't like ANTLR. Also, (purely imho) it spends too much time on the front end (lexing/parsing) and not enough on the rest. I have yet to see good books (other than DCPL or L.I.S.P) which uses a simple concrete syntax (s-expressions say) and focuses on the rest of compiler building.

Re:Books Programmers Don't Really Read by pmjordan on Tuesday April 27, 2010 @03:10PM (#1299307)
Thanks. I've got a pretty good understanding of lexing & parsing, so I would have gotten it for the other parts, but I won't bother.
Re:Books Programmers Don't Really Read by bad_user on Tuesday April 27, 2010 @11:05AM (#1298423)
> I've had terrible experiences trying to use ANTLR in practice, which kind of puts me off buying the book.

Yes, but it explains the parsing techniques used by ANTLR, and for learning stuff it's quite OK. It uses ANTLR as a teaching tool, but you don't have to keep using it afterwards.

For writing simple parsers you don't even need to read a book ... just use a parser combinator based on PEGs, like http://wiki.github.com/sirthias/parboiled/ and you'll be fine.

If you want a general purpose language however, even if you use a tool like Parboiled, you'll need to know how its guts work. It is also a good idea for a compiler to be self-hosting, because it's more portable that way and the compiler's code itself is a good test for your language ... so you'll need to know how to implement a parser by hand.

Of course, after the parser is done you'll need to have an AST, and maybe you'll want to optimize it ... this book is thin on such details, but it's better to start somewhere and books like the Red Dragon are quite heavy and can put you off the target before writing a single line of code.

Re:Books Programmers Don't Really Read by magoghm on Tuesday April 27, 2010 @09:34AM (#1298166)
After using JAVACC for a couple of years I switched to ANTLR. I found it slightly harder to learn but easier to use than JAVACC.