Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages (Pragmatic Programmers) 1st Edition
| Terence Parr (Author) Find all the books, read about the author, and more. See search results for this author |
Use the Amazon App to scan ISBNs and compare prices.
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.
Frequently bought together

- +
- +
Customers who viewed this item also viewed
From the brand
-
The Pragmatic Programmers publishes hands-on, practical books on classic and cutting-edge software development and engineering management topics. We help professionals solve real-world problems, hone their skills, and advance their careers.
-
Editorial Reviews
Review
""Throw away your compiler theory book! Terence Parr shows how to write practical parsers, translators, interpreters, and other language applications using modern tools and design patterns. Whether you're designing your own DSL or mining existing code for bugs or gems, you'll find example code and suggested patterns in this clearly written book about all aspects of parsing technology.""--Guido van Rossum, Creator of the Python language
""This text is excellent. The exposition plus the examples makes otherwise complex ideas very clear and accessible. Well done!""--Tom Nurkkala, Associate Professor, Computer Science and Engineering, Taylor University
About the Author
Terence Parr is a professor of computer science and graduate program director at the University of San Francisco, where he continues to work on his ANTLR parser generator (http://www.antlr.org) and template engine (http://www.stringtemplate.org). Terence has consulted for and held various technical positions at companies such as IBM, Lockheed Missiles and Space, NeXT, and Renault Automation. Terence holds a Ph.D. in computer engineering from Purdue University and was a postdoctoral fellow at the Army High-Performance Computing Research Center at the University of Minnesota, where he built parallelizing FORTRAN source-to-source translators. He is the author of "The Definitive ANTLR Reference":http://pragprog.com/titles/tpantlr.
Don't have a Kindle? Compra tu Kindle aquí, or download a FREE Kindle Reading App.
Product details
- Publisher : Pragmatic Bookshelf; 1st edition (January 26, 2010)
- Language : English
- Paperback : 374 pages
- ISBN-10 : 193435645X
- ISBN-13 : 978-1934356456
- Item Weight : 1.37 pounds
- Dimensions : 7.5 x 0.75 x 9.25 inches
- Best Sellers Rank: #295,464 in Books (See Top 100 in Books)
- #20 in Compiler Design
- #33 in Software Programming Compilers
- #60 in Microsoft .NET
- Customer Reviews:
About the author

Terence Parr is a professor of computer science and was founding director of the MS in Analytics program at the University of San Francisco, where he continues to work on his ANTLR parser generator (http://www.antlr.org) and template engine (http://www.stringtemplate.org). Terence has consulted for and held various technical positions at companies such as IBM, Lockheed Missiles and Space, NeXT, and Renault Automation. Terence holds a Ph.D. in computer engineering from Purdue University and was a postdoctoral fellow at the Army High-Performance Computing Research Center at the University of Minnesota.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonReviewed in the United States on January 21, 2018
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
One weakness I noticed that was not helped by Kindle was that there are a fair number of acronyms. Most of the time, they are defined and then used, but it took me quite some effort to find exactly what "IR" (intermediate representation) meant; though the context provided tentative hints. Kindle's search engine proved little help with these acronyms on several occasions -- particularly I remember that one, but there were others. I found the exact definition in a later chapter by the hard slog.
For the serious student or researcher who has the time to study the book more methodically, I'd recommend the printed version as almost all of these e-readers are still rather poor substitutes for hard paper and the single strongest advantage they might offer (the electronic search engine) is often unhelpful. It is also hard to find your comments written on the margins because all you are granted is a small speck in the text that you'll never find when searching back over the material. Dropping this one star is mostly due to the frustrations I had with Kindle and maybe not entirely the fault of the author. On the other hand, being available in electronic form was something I appreciated.
Working with embedded devices I never looked into how to implement a compiler, but I which I did! This book was an eye opener and timer saver, with concrete techniques on how to implement and work with trees, parsers, lexer, symbol table. This book is a must for all computer geeks. Go get Antlr4 book too https://amzn.com/1934356999!
The combination will save you lots of time and give you the edge to reach top tier and make you a guru!
Since studying this book, I have built custom interpreters mapping data stored in a custom human readable syntax into object instances at work. This has also allowed for working on an interpreter to map voice commands into executed actions on applications. While I certainly am no expert, this book really helped bring me out of the dark into being fairly proficient at building lexers and parsers and using them in real world applications.
Note that I studied Aerospace Engineer formally and study computer science and software engineering outside of that since I love it, so you don't need to be some Computer Science or Software Engineer by education to get a lot of value out of this book.
Top reviews from other countries
The book steers clear of fancy mathematical notation, instead, it uses clear examples and plain English explanations of otherwise complex problems. Compiler design is not easy, so it's a lot to ask that any book clears it all up for you, but I can say that I generally read this book first before attacking the same concepts in the other books which in turn makes me able to understand them better.
This book is brilliantly organized into chapters that target a specific topic regarding compiler design. So when I was attacking a problem regarding symbol tables, I found it easy to navigate to the section specifically targeting this subject. Same goes for generating bytecode, reading bytecode, managing memory, etc.
All I can say is if you're looking to construct a programming language, you shouldn't do without this book.
In my experience of writing compilers, the tool you use for the lexer and parser parts is only as important as getting you past those steps in the development. The more difficult part of writing a compiler is usually what you do after your language is parsed and you now have to do something with the parsed tokens. This book describes that stage as well. The book is well written and easy to read, which helps a lot. The book is medium thickness so not too daunting but substantial enough. I would recommend this book for a programmer who needs to implement a compiler or interpreter and doesn't want to get too bogged down in academic theory.
If you have used flex/bison (yacc/lex) this book will open your eyes to new modern technologies for language implementation
I find the writing style quite refreshing. I never felt bored while reading the book. The way the book is organized into patterns make it very easy to consume. Once you get used to the structure it is very easy to jump back and forth looking for the pattern that will solve your problem.
I'd recommend it to professionals rather than programming hobbyists.
Perfect in combination with the "dragon" book.
Creating a language seems at first like a daunting task that takes a lifespan but this book shows that it is not, especially if you need it just for giving some extra power to configuration scripts, in-application macros and the like.
This book presents in details, one by one, all the algorithms needed to read and execute a source code written in your own language.
You don't need knowledge of formal grammars and the like to use this book but it'd help. Or this book might be an inspiration to learn more.










