Tuesday, September 17, 2013
Compilers: Principles, Techniques, and Tools
Compilers: Principles, Techniques, and Tools |
Compilers: Principles, Techniques, and Tools Posted: I spent some serious quality time with the first edition (the "red dragon book"), in three main episodes over the past dozen years: 1) undergraduate compilers class, 2) industry project, and 3) parser generator implementation. During all three episodes, I was disappointed in various ways, though there is no denying that the book contains a wealth of information. As an undergraduate, I found the book somewhat impenetrable. When in industry, I found the book too abstract. When implementing a parser generator, I discovered that the book excludes important research results with regard to LR parser generation. It is the last disappointment that I will focus on. The book presents parser generation in layers of increasing complexity, from SLR to LR to LALR, where LALR is presented as the penultimate algorithm, though LALR parsers can only handle a subset of the grammars that LR can handle. The justification for this is that the original Knuth LR algorithm is intractable for large grammars. However, an efficient, fully correct, approach for LR parser generation was published in 1977, and on top of that it appears easier to implement than efficient LALR parser generation! The red dragon book's original authors simply cannot have been unaware of this research result, but I suspect that they elected to warm over the "green dragon book" (published in 1977) rather than incorporate the state of the art as of 1986 into the "red dragon book". Now here we are another 20 years later, and as near as I can tell from reading through available online information, the "purple dragon book" is perpetuating this omission. The result of the red dragon book is that we have an entire generation of computer scientists who have been mislead to think that LALR is somehow superior to LR, and the purple dragon book is setting things up for yet another generation to be mislead. |
You are subscribed to email updates from Shield To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment