DeRailed DSL (was Re: compile-time regex redux)

Walter Bright newshound at digitalmars.com
Sat Feb 10 22:51:27 PST 2007


Sean Kelly wrote:
> Please note that I'm not criticizing in-language DSL parsing as a 
> general idea so much as questioning whether this is truly the best 
> example for the usefulness of such a feature.

Compile time DSL's will really only be useful for relatively small 
languages. For a complex DSL, a separate compilation tool will be 
probably much more powerful and much more useful.

I don't know anything about database languages, so I'm no help there.

One example of a highly useful compile time DSL is the regex package 
that Don Clugston and Eric Anderton put together. With better 
metaprogramming support, this kind of thing will become much simpler to 
write.

There's often a need for custom 'little languages' for lots of projects. 
Most of the time, people just make do without them because they aren't 
worth the effort to create. I hope to make it so easy to create them, 
that all kinds of unforeseen uses will be made of them.

I'll give an example: I often have a need to create parallel tables of 
data. C, C++, and D have no mechanism to do that directly (though I've 
used a macro trick to do it in C). With a DSL, this becomes easy.



More information about the Digitalmars-d mailing list