TechBookReport logo

Keywords: Java, Groovy, Ruby, Clojure, Scala, scripting languages

Title: DSLs In Action

Author: Debasish Ghosh

Publisher: Manning

ISBN: 1935182455

Media: Book

Level: Introductory, though knowledge of Java, Groovy is useful

Verdict: Fairly academic, could usefully be more hands on


Domain Specific Languages (DSLs) are specialised programming/scripting languages that are designed to enable domain experts to write meaningful programmes in a language that they find natural and useful, and without the normal clutter and boiler-plate code that surrounds most general purpose languages (such as Java, Python, C# etc). For the user it creates a powerful and expressive way of performing complex ad hoc operations that wouldn't easily be accommodated in a standard application. For the developer who has to enable such interactivity then crafting a DSL is an elegant way of allowing domain experts to write their own programs without having them learn a 'proper' programming language. Most developers have toyed with the idea of creating their own programming languages at one time or another, so a DSL is the chance to do it for real, even if it's for a very specific and limited domain.

It's an interesting challenge, and so there's plenty of scope for a good book on the subject. And, on the face of it at least, 'DSLs In Action' ought to be that book. It promises to look at the topic in some depth and then to move on to creating DSLs using Groovy, Ruby, Clojure and Scala (all languages that can live in the Java enterprise ecosystem by using the JVM). Unfortunately the book simply doesn't live up to expectations.

At issue is the amount of repetition and the sheer verbosity of the text. It repeats information again and again, for example there really is no need to keep repeating the list of languages that make for good DSL creation. We get the picture early on that Groovy, Ruby, Clojure and Scala have the kind of dynamic meta-programming capabilities that are required, but the list is repeated again and again. As is the advice on finding the right abstractions in the given domain. And we're reading the book because we're interested in DSLs, so why keep going over the same set of advantages?

The focus of the book is heavily weighted towards architectural and theoretical topics, but there is a short-fall in the amount of attention to the nuts and bolts of creating a solid and extensible DSL. From an academic point of view, if you are interested in different classes of DSLs, design patterns, parsers etc then you may find this level of detail useful, if not it's likely to get in the way more than anything else.

Obviously there's a need for some examples, and on the whole these are from the financial services domain - trading systems for stocks and shares primarily. This is fine and even if you're unfamiliar with the territory the side-bars, and the discussion in the text, give enough context for it to all make sense. The author does a good job of whetting the apetite with some samples of what DSLs for this domain could look like.

However, it would have been really useful to go through creating the DSL in real detail in some of the languages that are covered. Part two of the book does go some way to doing this, but it's not a solidly worked example at sufficient depth. Instead there are snippets of information throughout the text, as well as additional information in the appendices. As a developer a complete case study in each language would have been of real use, probably of more use than the detailed discussion of DSL patterns, taxonomies of DSLs, future trends in DSLs etc.

This isn't a long book, but it could have been shorter still. Generally Manning's 'In Action' series set a high standard, but this one doesn't quite make it (though judging by some of the rave reviews on the web I would hazard a guess that Manning have been generous with the review copies - one of the advantages of a site like TechBookReport is that we tell the truth about all of the books we review).

So, interesting in an academic kind of way, but certainly not hands on enough for this reader.

Hit the 'back' key in your browser to return to subject index page

Return to home page

Contents © TechBookReport 2011. Published June 16 2011