Domain Specific Langauges = The Long Tail of Programming Languages? ( Part 1 )
In Chris Anderson’s book The Long Tail ( book review coming soon ) he describes what the long tail is and how it applies to different forms of business and economics. Music, movies, and books are just some of the areas that the long tail is radically changing the way we think about selling. Companies such as iTunes and Amazon are now noticing that if you add up all the money from the few sales of a large about of items, it’s actually more money that the large amount of sales of a few “hits”. This is because of what Chris coins as the “rise of the niches”.
With more and more choices, consumers aren’t confined to what the producers of content think is popular. More and more content means the ability to have more and more choice. Music is no longer just “Electornic”, but “Drum & Bass”, “House”, “Acid Jazz”, etc…
The result is more specialized niches that fill customers needs.
What does this have to do with programming languages?
Well, with the recent rise in popularity of DSL’s, or Domain Specific Languages, more and more specialized langauges are being produced that meet and smaller and narrower need. This follows Chris’s pattern of the long tail, becuse it’s getting easier to not only produce these languages ( with DSL workbenches ) but distribute them as well ( IDE integration ). This harkens back to my days as a unix admin, where all the tools I had ( sed, awk, grep, find, etc… ) did one thing, and did it well.
I find this interesting, because it flies in the face of previous cycle of defining a programming language to be as general as we possibly could, in the hopes that one language will solve all our problems. Then, getting frustrated when a new problem comes along that can’t be solved by it, we throw the previous language away and grumble that we have wasted our time on a “junk” language, before turning to next “hot” language. I’ve seen it several times in my short programming career, from C to C++ to VB to Java to .NET.
This is now changing. The poster child for the rise of DSL’s is Ruby on Rails. DHH recently attended RubyConf, where Dave Thomas of the pragmatic programmers presented a list of things that needed to be added to Rails to make it more “enterprise friendly”. DHH responded with a stern ‘no’. His rationale was that if you wanted to do something that RoR didn’t do, use something else. RoR is a particular programming environment, for a particular type of application. If you’re not doing that type of application, tough. Don’t use RoR.
I find this refreshing. Hopefully other people will start to embrace learning different types of languages for different functions. Yes, the number of languages you will need to learn will increase, but the overall depth and scope of what you need to learn in each language will be significantly smaller.
Therefore, when the time comes to learn a new language, you won’t be throwing the old language out because it doesn’t do something in particular. You can simply pick up the new language, churn out some simple apps, and presto, problem solved. You’re smarter and have a much more maintainable solution because you didn’t try and shoehorn the problem into an already existing solution space.
If all you have is a hammer, everything looks like a nail. Similarly, if all you have is Java, every application looks like a heterogeneous, massively scalable, distributed enterprise application.