Tuesday 15 April 2008

Bjarne Stroustrup on DSL's

I found an interview with Bjarne Stroustrup of C++ fame on MSDN Magazine where they asked him about DSL's.

I noted that he also thinks DSL's need a general purpose (I used the word broad) language fall back position.

Q: What are your thoughts on DSLs in general? What do you envision as the relationship between DSLs and general-purpose languages?



Bjarne: I worry about the number of languages being designed, implemented, introduced with great fanfare, and then fading away without significant impact. During this—typically many-years long phase of development—a new language consumes significant resources with essentially no returns. I wrote a paper on this phenomenon called "A Rationale for Semantically Enhanced Library Languages" (research.att.com/~bs/SELLrationale.pdf). I argue for using libraries, possibly supported by tools, and a general-purpose language.
I think that a DSL should be a last resort, not a first. If at all possible, the DSL should be firmly rooted in a general-purpose language and standard tool chains. A DSL needs a general-purpose language (or at least a systems programming language) for its implementation and the implementation of its run-time primitives. I think it would be best if a DSL is consciously and firmly paired with at least one general-purpose language so that it is easy to add new facilities through the use of libraries written in that general-purpose language. Obviously, a professional should master several languages, but I do wonder if the sum of complexity of a variety of DSLs couldn't become so high that it became a problem. Also, many (if not most) DSLs seem to "want to" become general-purpose languages.

Here's the full interview if you want to see his opinion on other things.

No comments: