February 4, 2010

Language Implementation Patterns--New from Pragmatic Bookshelf: Create Your Own Domain-Specific and General Programming Languages

Raleigh, NC—Developers crave the power of creating their own domain-specific languages. It's a very practical, productive technique that lets developers boost their productivity by building applications that are tailor-made for their unique requirements. However, most books on language development can be a waste of time. They dwell on building compilers and give the impression that language development requires a lot of theoretical computer science.

Terence Parr shatters that impression in his new book, Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages (Pragmatic Bookshelf, $34.95). Using detailed descriptions of 31 language patterns—common data structures, algorithms, or strategies—Parr demystifies the universal elements of languages. The patterns aren't presented as language design theory or a library of language implementations, they're presented as tools for developing modest, day-to-day language applications. This is language development put to pragmatic use.

Organized into four parts, the book leads readers to a rich understanding of DSLs and general-purpose programming languages. First, Parr presents the overall architecture of language applications and the key patterns of language recognition (parsing). Next, he uses parsers to build trees that represent language constructs in memory. By "walking the trees," language developers use patterns that check whether input streams make sense. Then, in the third part, Parr reveals patterns for high-level and bytecode interpreters. Last, he shows how to translate languages and generate text using the StringTemplate template engine. Drawing on the architecture of some interesting language applications, readers then launch into building their own languages.

Readers apply the patterns toward building configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. Code snippets and implementations are written in Java and ANTLR (the well-known parser generator that Parr created).

But you're not limited to Java or ANTLR. As Parr points out, "You'll have no problem transferring your knowledge to other tools after you finish the book. It's like learning to fly—you have no choice but to pick a first airplane. Later, you can move easily to another airplane. Gaining piloting skills is the key, not learning the details of a particular aircraft cockpit."

No longer is language development the dark art of computer scientists. Using the patterns shared by programming languages, developers can reap the rewards of building DSLs. Language Implementation Patterns gives developers true power: the power to code in their own language.

Advance Praise
"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


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).

Additional Resources
For more information about the book, including code, errata, discussions, full table of contents, excerpts from the book and more, see the catalog page for Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages.

Language Implementation Patterns
Language Implementation Patterns
Publisher: Pragmatic Bookshelf
Terence Parr
ISBN: 9781934356456, 350 pages,
Book Price: $34.95 USD, £24.99 GBP

About Pragmatic Bookshelf


About O'Reilly



Customer Inquiries
Sales/Customer Service

Contact Mary Thengvall
O'Reilly Media
(707) 827-7119

© 2008, O'Reilly Media, Inc.