Saturday, December 20, 2008

Jamis Buck on Writing Domain Specific Languages

Saw this post recently:

Writing Domain Specific Languages.

As the post title indicates, it's about writing DSLs (Domain Specific Languages) and it is written by Jamis Buck, who works for 37 Signals.

The post was interesting. (It is mostly geared towards writing DSL's in Ruby, though, so if you don't use Ruby you may not find it of interest.)

One small comment I have on it is that, regarding the benefits of DSLs he seems to focus more on the "naturalness" of them, by which I think he means the closeness of DSLs to natural languages like English. While that's an important benefit, I think another benefit of DSLs is when they actually are designed to let the user of the DSL program closer to the domain - after all, that's what the "D" in "DSL" stands for. However, he does say something along those lines, and one other point I liked about the post was this line:

"A DSL can be thought of as (and many cases, really is) an API for your application."

I've always thought the same myself, and this concept is really more or less the same thing as the concept of writing your app as a (set of) libraries (and then finishing the app off by having the main function or method call those libraries as needed) - a topic that I think is important, and have blogged about a couple of times before.

Vasudev Ram - Dancing Bison Enterprises.

No comments: