Learn to build configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. You don't need a background in computer science--ANTLR creator Terence Parr demystifies language implementation by breaking it down into the most common design patterns. Pattern by pattern, you'll learn the key skills you need to implement your own computer languages. Knowing how to create domain-specific languages (DSLs) can give you a huge productivity boost. Instead of writing code in a general-purpose programming language, you can first build a custom language tailored to make you efficient in a particular domain. The key is understanding the common patterns found across language implementations. "Language Design Patterns" identifies and condenses the most common design patterns, providing sample implementations of each. The pattern implementations use Java, but the patterns themselves are completely general. Some of the implementations use the well-known ANTLR parser generator, so readers will find this book an excellent source of ANTLR examples as well. But this book will benefit anyone interested in implementing languages, regardless of their tool of choice. Other language implementation books focus on compilers, which you rarely need in your daily life. Instead, Language Design Patterns shows you patterns you can use for all kinds of language applications. You'll learn to create configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. Each chapter groups related design patterns and, in each pattern, you'll get hands-on experience by building a complete sample implementation. By the time you finish the book, you'll know how to solve most common language implementation problems.
The book explains a lot about implementing languages and it is definitely worth a read. The table of contents is impressive enough. Furthermore, the author has written a lot of executable code for each chapter, so you can play with the techniques explained. Unfortunately (for some), all the code is ANTLR and Java. While not necessarily bad, I'm under the impression that people who like Java and people who are interested in language implementation are two (almost) disjoint sets. Furthermore, it feels less rigorous and more "hands-on" that befits the subject.
Apart from that, it is an awesome book and definitely worth reading if you're into the subject.
I have not read the last half of 12th chapter and the 13th chapter. So take my review with a grain of salt. Also, I'm not that good at reading technical books too, so also take that into account.
TL;DR: You want to learn about the science behind compilers, probably not the best. If you want to straight away implement the compiler, probably the best.
With that out of the way, let's focus on the book. The one major downside I found in the book is that it is written for the older version of ANTLR. So you can't just start copy pasting code and start tinkering with grammars right away. You gotta combine it with the ANTLR v4 reference. The algorithms presented in the book are pretty easily adaptable to the v4 of ANTLR. As any of you reading the book should know, this is not a theoretical or conceptual book. This is down right implementation focused. It could be considered its strength and also somewhat of a weakness. The book is simple, I'd definitely give it that. Terence has done a great job boiling it down to just the essentials, so almost anyone can follow it. Even a person who has never done anything with compilers and just knows Java will do fine, except for some bits where help might be needed. Sometimes I think that the author has taken one too many examples and so the book feels slow. All in all, great book.
An excellent book on programming language implementation patterns written in the style of Gamma et al. It presents patterns for lexing, parsing, static analysis, interpreting, unparsing, and more. It provides examples using ANLTR (the parser generator/tree walker the author has been writing for many years). My only beef is that the earlier patterns were more clear to me then the later patterns. This may have been a function of my smooth brain, but regardless this is a great reference book!
A nice reintroduction to computer science theory and how parsing and compilers work at the lowest level. The structure makes sense, but as soon as the author starts a part it quickly jumps to other things that are related, but not need to be introduced right now. It’s rather useless when you try to build your own domain specific language on top of something existing.
A very practical book. It doesn't dwell in the theory that you might get in an early CS class and skips ahead right to the patterns necessary for parsing, analyzing, transforming, generating, and interpreting your own domain-specific languages.
Un buen libro para conocer técnicas y patrones que sí son comunes en la implementación de lenguajes. Mi única objeción (caprichosa) es que los ejemplos están en Java y están diseñados con objetos. Las ideas siguen siendo claras.
Excellent overview of how to get started implementing a language. This is the book that got me interested in compilers and gave me the tools to write my first interpreter and compiler.
Most of the book is around ANTLR. I want to learn how to do this stuff from scratch, not generate everything from grammar. Theory part was good and that is the only reason for 3 stars.
Helped me immensely during my dissertation - covered and exposed a lot of concepts I needed to understand and that weren't being touched on at all at an undergraduate level.
Mostly just used it as a reference book and didn't read it cover to cover but I think just as a programmer you can gain a lot of insight from understanding these concepts and I'll likely come back to it in the future to further explore.