Monday, May 14, 2007

DSL - good servant, bad master

I'm always happy to read, hear or watch anyone writing, talking or presenting about Language Oriented Programming and/or Domain Specific Languages as it is my favourite topic and I have a soft spot for it.
I dipped into presentation he had at JavaOne conference entirely alike (I was not that lucky to hear the talk, however).
Neal goes through the classical examples of DSLs and explains the main benefits of LOP. Although it mostly describes nothing new, I did like reading it since it proofs more people is starting to be interested in it.
I liked the word context he mentioned when talking about the main feature of DSL. It is certainly true that every specific language has a domain that can also be called its context and that this context is always implicitly given for each single DSL.
But that is not the main thing I want to draw one's attention to.

One thing struck me. The simplicity with which he added new language constructs into this language. I was not struck positively, however.
I remember having similarly mixed feelings with overloaded operators in C++. Although it was contributing when used smartly for creating a completely new library (everyone is familiar with iostream library and << operator), it was disservicable when a programmer overloaded his/her operators recklessly (and headache to read such code). One could be sure with nothing.
I believe - it is good to create new languages as it is good to create tools to help design these new languages. But I do not believe that most people will be able to easily create new languages in the correct way where correct way means not to mess things up.
Not many SW developers are skilled enough to design good API and creating a new language is not an easier task either. Design of languages is a job for language designers -> simple way of adding new constructs to a language is not a feature intended for broad public. Moreover I believe that every non-trivial language should contain guidelines and design patterns to use this language. Again, to bring such patterns up is not a task for an ordinary programmer.

P.S. It is also worthy to see this video, an older Neal's presentation about DSL/LOP - some slides seem familiar.