DSL book in progress 6

Posted by Warner Onstine Wed, 10 Oct 2007 16:44:00 GMT

Now that things feel a little bit more final to me I thought I would take this opportunity to announce the book that’s been keeping me from blogging. The tentative title is Creating DSLs using Java and Groovy and it will be published by Pragmatic Programmers. I started working on this idea after last years No Fluff Just Stuff where I saw Neal Ford speak on DSLs and I talked to him briefly about a project I was working on. His talk inspired me to push forward with using DSLs for code generation specifically using Groovy.

The book will cover both Java and Groovy techniques for writing DSLs, as well as have some general guidelines for writing DSLs. We also have a chapter on ANTLR and JavaCC for writing external DSLs using Java. I tried to cover as much as I could of Groovy meta-programming and some of the additional capabilities of Groovy that make it a good language to write an internal DSL on top of, but there’s only so much space ;-).

We just sent off the book for peer review, which means its about half-way finished, maybe a little more. We are currently shooting for a release date sometime early next year, which looks very doable at this point, but I expect a ton of edits to come back from this first review.

On a final note I just want to say what a pleasure it has been working with the PragProg crew. I love, love, love their book build system and my editor Susannah rocks. I have had a blast working with them so far on this book and am looking forward to finishing this up and getting it published.

Trackbacks

Use the following link to trackback from your own site:
http://www.warneronstine.com/blog/articles/trackback/303

Comments

Leave a response

  1. Dierk König about 5 hours later:

    How cool!

    Good luck for your book! I can hardly wait to have it in my hands.

    Dierk

  2. Tom Copeland about 23 hours later:

    Hi Warner - you may have all the reviewers you need, but if you want someone to take a look at the JavaCC bits I'd be happy too; just let me know. And best of luck with the book, sounds like a great project!

  3. Claus Hausberger 1 day later:

    very cool. consider one sold !!

    Claus

  4. Groovy Caesar 2 days later:

    I have been waiting for a book like this. Good luck.

    I'll be purchasing mine on the first day of release!!

  5. k.barclay@napier.ac.uk 5 days later:

    Warner

    These past 6 months I have been investigating how we might provide support for external DSLs in Groovy. I was particulary keen to find a 'groovy' solution.

    This led me to consider combinator parsers as a means of defining the language of the DSL. I have been able to implement a meaningful combinator library using Groovy closures. The code is surprisingly small by quite expressive. With the combinators I am able to directly express in Groovy the DSL grammar. One of the simple combinators then allows me to define a transformation of the parsed input into an AST.

    Presently I am extending this work to incorporate error reporting. This too is a combinator that makes a parser report errors should it fail.

    I would be pleased to discuss my work with you. I hope to get some stuff onto one of the Groovy blogs that describes all this.

    Ken

  6. Warner Onstine 5 days later:

    Thanks all for the comments, I will be keeping everyone up to date on the progress of things.

    @Tom - I'll let you know if we lose any reviewers this round.

    @Ken - Your work sounds really interesting let's definitely chat!

    -warner

Comments