Designing and Implementing DSL languages: recommended reading?

I have a great interest in learning more about Domain Specific Languages (DSL) and how to design and implement them. So I though there is no better place to ask for this than here at LtU.

I am primarily interested in building modular language interpreters that will be embedded in other languages such as Java. So I would like to understand the basic semantic building blocks of programmming languages and then different strategies and techniques for implementing them. I am more interested on language semantics and implementation, and less on language syntax.

So if you had to recommend to me a set of books, papers, etc that could walk me through all this from beginning to end, what would that be?

Any info/references would be great.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

a few resources

Here's a bibliography you might find useful. You might also want to read the the weblog entries Bill Clementson wrote on the topic for some more overview-type resoruces, or check out the "other application topics" section of the "applications" page of ReadScheme for many case studies.

Check out Paul Hudak's writings.

Paul Hudak has written a Haskell tutorial book that uses two DSLs for teaching, GraphicsLib for graphics and Haskore for scoring music.
Hudak is part of the Yale Haskell Group, where he has worked on other DSLs such as Dance for describing humanoid robot control and human dance choreography.

You might also want to read his paper Modular Domain Specific Languages and Tools

--Shae Erisson -

A few books

While not dealing with DSL's per se; The Art of the Metaobject Protocol is a recommended read. It disucsses the design of one of the classic examples of metaprogramming (though domain-independent)--the Common Lisp Object System.

A recent book that I can recommend is Krzysztof Czarnecki and Ulrich Eisenecker's book Generative Programming, the website of which is here

And you might consider studying Aspect Oriented Programming, an emerging paradigm that deals with such stuff. One book I can suggest is Invasive Software Composition by Uwe Assmann (how does one type a scharfes-S into Firefox? :). It focuses on techniques for invasively composing software modules (by "invasive", one or more modules can be modified--or a "copy" created and modified--in the process). Website here.

type a scharfes-S into Firefox...

The question is only how to type an sz (this: ß) in your operating system. At least, it should be.

Tony Hoare's

Hints for Programming Language Design.

Or use Lisp and embrace the implementation mechanism instead of having to hide it.

Our DSL department

As well as the DSL dept. on LtU1 ("classic" archive)

Language design

Another useful thread.

DSL should target specific problems so there is little reading

A DSL needs to address specific needs or else you are better using a language already out there. Therefore you are better reading about graph optimimizations, tree rewriting, data flow analysis, query compilation and the likes to then put together a simple yacc based front end or use an existing language as your front end.

Domain Specific Modeling information

Try DSMforum, you will find it here

Also interesting are these blogs:

Juha-Pekka on DSM
Steven Kelly on DSM