Computers were supposed to do all the work for all humans, but as programmers we often neglect that very basic purpose of these machines. So we go on writing code doing every little bit ourselves, sure there are libraries to do some of that but using libraries does not really solve the problem. Good design for software is important, but we should not be designing and thinking how to write code when we want to download a file from network, when we need to parse an XML file, or any other easy but mundane task.
I have always thought about domain specific languages as a way to not only boost productivity but also free our thoughts from these small menial and mundane tasks. I am so excited about domain specific languages that I have thought numerous times to continue some research studies in this area. Sadly I havent been able to find any good place yet in Helsinki.
QML or QtQuick is an excellent DSL for creating nicely animated user interfaces, not just for desktop computers but also for mobile devices. The productivity boost is immense, I wrote complete applications in Qt Quick in weeks which even iPhone developers took months to write. Still more wild that the Qt Quick app ran fine on N900, N8 and other Nokia Qt devices. Since that time I have been hooked on Qt Quick. I havent found a better DSL for UI’s than Qt Quick. It is so simple, no crazy xml syntax like in XAML. XAML might be more powerful but the power is lost in its complexity and IMO bad idea of using XML.
The second experience of DSL came with LINQ when I wrote my first app for Windows Phone. I had previously done similar app on Android, iPhone and Qt/Symbian where I needed to parse huge XML documents, so I had to spend weeks just to write the code to handle the SAX events and create a state machine. This code was fragile and just too much work. Thank god for json.
Coming back to the point, the experience of parsing XML with LINQ was quite the opposite, it was … pleasant and enjoyable. I was amused by the speed at which I wrote the code and how simple it was. It all made sense.
I think Microsoft is on the right path. They already have two DSL’s incorporated in Windows Phone development, writing apps therefore for WP is quite easy and fun experience.
I hope in the future DSL’s will become even more common and we will have write apps in DSLs which are then glued together by a general purpose language.