views:

241

answers:

4

I've been looking into designing some Domain Specific Languages which I will probably implement in Clojure, but I really don't have any idea of what's involved.

The languages I have in mind are intended to be abstract languages that are readable by domain experts with little or no programming background.

Does anyone know of any tutorials, books, or other references that would be helpful?

+6  A: 

You might like Martin Fowler's nascent book Domain Specific Languages. It is a work in progress and much of it is available on line. It's intended to be language agnostic.

Below are some presentations from RubyConf that I've found useful (concepts at least should map to Clojure):

Martin Carpenter
+1 - David Fowler seems to show up a lot in answers, but I believe he stopped updating the book online as he is now speaking with a publisher.
James Black
+3  A: 

Language Implementation Patterns by Terence Parr, the creator of Antlr and String Template, arguably the best tools to generate parsers and lexers.

The book is currently in "beta" but it is still a good read. If you purchase it, you will get updates and also the final release.

Darien Ford
+2  A: 

It is early in my evaluation, as the book is still being completed, but DSLs in Action, http://www.manning.com/ghosh, seems good.

You can also look at Building Domain Specific Languages in Boo, http://www.manning.com/rahien.

James Black
+2  A: 

It looks like you're describing an external DSL. For that you need to set up a parser.

You have two options: write your own (which can be difficult) or use an existing system such as ANTLR to define the grammar. It's Java so it should be compatible with Clojure.

Eric Normand