Sign in to turn on 1-Click ordering.
Trade in Yours
For a 3.00 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Image not available

Tell the Publisher!
Id like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

DSLs in Action [Paperback]

Debasish Ghosh

Price: 28.99 & FREE Delivery in the UK. Details
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 1 left in stock (more on the way).
Dispatched from and sold by Amazon. Gift-wrap available.
Want it Wednesday, 23 April? Choose Express delivery at checkout. Details
Amazon.co.uk Trade-In Store
Did you know you can use your mobile to trade in your unwanted books for an Amazon.co.uk Gift Card to spend on the things you want? Visit the Books Trade-In Store for more details or check out the Trade-In Amazon Mobile App Guidelines on how to trade in using a smartphone. Learn more.

Book Description

7 Jan 2011 1935182455 978-1935182450 1

Your success—and sanity—are closer at hand when you work at a higher level of abstraction, allowing your attention to be on the business problem rather than the details of the programming platform. Domain Specific Languages—"little languages" implemented on top of conventional programming languages—give you a way to do this because they model the domain of your business problem.

DSLs in Action introduces the concepts and definitions a developer needs to build high-quality domain specific languages. It provides a solid foundation to the usage as well as implementation aspects of a DSL, focusing on the necessity of applications speaking the language of the domain. After reading this book, a programmer will be able to design APIs that make better domain models. For experienced developers, the book addresses the intricacies of domain language design without the pain of writing parsers by hand.

The book discusses DSL usage and implementations in the real world based on a suite of JVM languages like Java, Ruby, Scala, and Groovy. It contains code snippets that implement real world DSL designs and discusses the pros and cons of each implementation.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

What's Inside

  • Tested, real-world examples
  • How to find the right level of abstraction
  • Using language features to build internal DSLs
  • Designing parser/combinator-based little languages

Frequently Bought Together

DSLs in Action + Domain Specific Languages (Addison-Wesley Signature) + Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages (Pragmatic Programmers)
Price For All Three: 89.13

Buy the selected items together

Product details

  • Paperback: 376 pages
  • Publisher: Manning Publications; 1 edition (7 Jan 2011)
  • Language: English
  • ISBN-10: 1935182455
  • ISBN-13: 978-1935182450
  • Product Dimensions: 23.5 x 18.7 x 1.9 cm
  • Amazon Bestsellers Rank: 492,644 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, and more.

Product Description

About the Author

Debasish Ghosh, Chief Technology Evangelist at Anshinsoft, is passionate about programming languages and cooperative polyglotism. He has developed systems using multiple JVM languages and has designed DSLs using Java, Ruby, and Scala. Debasish is a senior member of the ACM and an active blogger on programming techniques and languages.

Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Reviews

There are no customer reviews yet on Amazon.co.uk.
5 star
4 star
3 star
2 star
1 star
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.8 out of 5 stars  4 reviews
17 of 18 people found the following review helpful
5.0 out of 5 stars Five languages, no trivial examples! 19 Jan 2011
By John Griffin - Published on Amazon.com

Once you implement a domain model in your favorite programming language, it no longer speaks the dialect that the domain expert can understand. If your implementation doesn't conform exactly to the specifications you agreed on with the domain user there's no way it can be verified by the person who understands the domain rules.

DSLs in Action addresses this by suggesting a DSL-driven application development model. Design your domain APIs around the syntax and semantics that the domain user understands. Then, even during the development of the code base, the user can do incremental verifications of the domain rule implementations. If your code speaks the language of the domain, it becomes clearer to the person who develops it, to the one who maintains it, and to a nonprogrammer domain expert who understands the business.

You will learn how to design and implement DSLs using the modern languages Ruby, Groovy, Scala, Clojure and Java. In addition, discussions of the strengths and weaknesses of these languages when designing a DSL are included.

Admittedly, not everyone will be familiar with all the programming languages used to implement the DSL structures in this book so the author has included short reference cards (or cheat sheets) for the languages in the appendixes. More thorough references are provided to complete texts to supplement them. The source code for all examples in this book is available from Manning's website, [...].

The author, Debasish Ghosh (@debasishg on Twitter), is the chief technology evangelist at Anshinsoft ([...]). He's a senior member of the ACM and his blog is at Ruminations of a Programmer ([...]).

Summary of Contents

Part 1: Using DSLs
Chapter 1: Learning to Speak the Language of the Domain
What a DSL actually is and the benefits it can provide start this chapter. The structure of a DSL is covered. The chapter concludes by tying in appendix A and discussing what makes a well-designed abstraction.

Chapter 2: The DSL in the Wild
Here you create your first DSL using Java. Groovy is introduced to demonstrate how to make the DSL more Expressive. DSL implementation patterns are introduced and how to choose a DSL type is presented.

Chapter 3: DSL-driven Application Development
Integrating internal and external DSLs in an application is the main topic of this chapter. Once this topic is completed, error and exception management is discussed and performance optimization is covered.

Part 2: Implementing DSLs
Chapter 4: Internal DSL Implementation Patterns
The author demonstrates how to build a programmer's toolbox of architectural patterns that can be used to implement DSLs. The use of metaprogramming to aid in the construction is extensively covered.

Chapter 5: Internal DSL Design in Ruby, Groovy and Clojure
The running application typical of Manning books, in this case a stock trading processor, is introduced here. The initial implementation is in Ruby and then it is improved with Groovy. Clojure is introduced to demonstrate how one must think a little differently with this language. A discussion of the pitfalls of each of these languages concluded the chapter,

Chapter 6: Internal DSL Design in Scala
This chapter is dedicated to Scala to which the author gives a good introduction. Developing an internal DSL with Scala is then covered. A discussion of monadic structures rounds out the chapter.

Chapter 7: External DSL Implementation Artifacts
This chapter is dedicated to the tools used to generate an external DSL. Parsers are discussed along with ANTLR, the Eclipse Modeling Framework and Xtext.

Chapter 8: Designing External DSLs using Scala Parser Combinators
Beginning with a discussion of exactly what parser combinators are this chapter continues with the Scala parser combinator library. A discussion of packrat parsers follows and then a dive into Scala DSL design with the combinators finishes up.

Part 3: Future trends in DSL development
Chapter 9: DSL Design: Looking Forward
The main thrust of this chapter is to touch base on developing trends in the DSL world. DSL workbenches are canvassed. The important topic of DSL versioning and practices that you can adopt to ensure a smooth evolution of your DSL's syntax rounds out the book.


Not for beginners. At first this book comes at you so fast that it can seem overwhelming but hold on it does get better. Although this reviewer would not call this a 'Magnum Opus' it is as close as you get without being one. It becomes immediately clear that the author knows what he is doing and does this sort of thing everyday.

Ruby, Groovy, Clojure and Scala along with Java are used in the examples and this reviewer and the author are willing to bet that the reader is fluent in at least one of those languages. The good thing here, as the author says, is all of the code is understandable regardless of whether you have experience with one of them or not. It should also convince readers to do what they've said they were going to do for the last three years and learn a new programming language. One excellent side effect of so many languages in such a small space is that you will learn how each of them makes you think about and approach a problem differently.

The book contains excellent discussions of domain cognizance with topics such as accidental complexity and minimalism in coding followed with a great review/introduction of the differences, strengths and weaknesses of Internal DSLs versus External DSLs. There is even a chapter dedicated to designing external DSLs via Scala parser combinators.

It is an exhaustively wide and deep coverage of the subject. By the time you've finished reading the book, you'll have a thorough understanding of the concepts that you need to master in order to design domain abstractions that your users can understand and appreciate. This will bring much added business value to any project.

Five languages with no trivial examples all in one book, highly recommended.
8 of 9 people found the following review helpful
4.0 out of 5 stars A pragmatical book on DSLs 9 Jan 2011
By Federico Tomassetti - Published on Amazon.com
This book introduces DSLs in the right way. It explains well their importance and later it explains how to realize the first internal DSLs easily. The author created a really smooth path into the DSLs realm and I think it is a great accomplishment. Moreover the author masters many languages and it is able to explain the differences between each of them, providing advices to choose the best option to implement your DSLs. Reading this book you will play with Ruby, Scala (the langauge the author seems to prefer), Groovy and Clojure. I appreciated very much the inclusion of a functional language, I think it gives completeness to the topic of internal DSLs.

On internal DSLs this is absolutely the most pragmatic and complete resource I had ever read.

On external DSLs the author introduce the important concepts and provide an example using Xtext (in my opinion the best technology to use right now).

I also appreciated the chapter on the future trends. I think it gives some ideas about what we should expect from DSLs and analyzing the trend towards more expressivity. The concept of DSL workbench is also introduced.

Finally seven appendixes add value to book: we have cheat sheet for [Ruby|Scala|Groovy|Clojure]'s DSL-friendly features, notes on polyglot programming, an appendix on metaprogramming.

In my opinion this book is definitely worthy the money, there is a lot of value on it so take a look to it.
3 of 4 people found the following review helpful
5.0 out of 5 stars Wonderful book 15 Feb 2011
By Alexey Ott - Published on Amazon.com
Great book on how to design, implement and use domain specific languages.
Author started from common description of DSLs, show different approaches to they building (for both internal, and external DSLs), and provided a lot of examples in different languages (Groovy, Ruby, Clojure, and Scala (his favorite).
So, after reading this book, you'll able to design and create your own DSLs.
P.S. there is also great philosophical appendix on designing "good" programs - it really worth to read it to many peoples.
3 of 5 people found the following review helpful
5.0 out of 5 stars Great book, good theory and practical examples 29 Jun 2011
By Berlin L. Brown - Published on Amazon.com
I too have been interested in compilers, language design, DSLs. I have a couple of books on ANTLR, Computer Science Compiler Design and other misc DSL books.

They have their strengths and weaknesses but most of them are things you might already know or with ANTLR, content you can look-up online. The books seem dry and not interesting. You have to force yourself to go through them. And even if you go through them you aren't interested in actually taking the time to go through the example.

DSLs in Action was a fun book to read. It a wide range detail from some of the theory to the case studies to useful examples. It was a solid book that really kept me interested in the material. I have been hoping that a book would cover, Scala and Lisp and Ruby. This book touches on some of the subjects.
Were these reviews helpful?   Let us know

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
First post:
Prompts for sign-in

Search Customer Discussions
Search all Amazon discussions

Look for similar items by category