Jim Freeze has an interesting post about writing DSLs in ruby. Check What is a DSL? – O’Reilly Ruby:
The third time around, after the Ruby DSL hype had been going around for a while, I decided to use Ruby. This time, I was able to create the DSL in about five minutes. It was readable, and I was able to focus on the end users frame of reference.
The moral of this story is, don’t write a mini language if you don’t have too. And, don’t settle for a simple DSL when a full featured one is needed. Consider extending a GPL into a DSL. Particularly an expressive language that is good at creating a readable DSL — like Ruby.
IMHO the key point here is that it is easier to code your domain in the simplest and expressive way (ala DDD), and later let it emerge a DSL shaped on that, rather than build a priori a monstrous DSL with a formal definition, a parser generated from a grammar, etc. And XML/XSLT don’t help either, both for readability and handling issues.
Many thanks to Lawrence Oluyede for having me signalled this.