>The Latest HOT Term

>So..every few years it seems we have to come up with a new HOT or Cool buzzword in the tech community. It seems that DSL is now that term. For those that have been hiding underneath a rock for the last year, DSL = Domain Specific Language. Think of this as a custom programming language designed to handle a very specific task. Wikipedia has a decent definition. DSLs aren’t knew, they’ve been around since the age of 1s and 0s.

We in the programming world seem to invent new DSLs everytime we touch the keyboard. Existing items aren’t good enough or may be too wordy. DSLs give me cramps. I think in many cases they are over used and for the wrong reasons. Now that isn’t to say that I don’t think there is a need for them, when they are done for the right reasons. However, it seems that everybody’s answer to a problem now is to create a DSL.

The problem with DSLs is that it’s yet another language one has to learn to maintain software. My head is already cramped full of various utility languages and I’m sure it will be cramped with some more over time, but many of these languages don’t provide the convience that they try to provide. Ask yourself before coming up with another language:

  1. Is there a currently supported standard that works?
  2. Can I extend this existing standard DSL?
  3. If not, why not?
  4. Will creating yet another DSL really solve the problem and make it easier to maintain going forward.

I work with XML which itself is a DSL for creating other Markup Languages, and its simplicity of implementation and power has also been its bane as well. XML is over used in many situations because it is too convient to use. With this said, there are a hand full of programming DSLs with in the XML world. Some are better than others, and several are starting to evolve into general purpose languages in their own right. Some examples.

  1. XSLT – functional language used for transformations. Comes in two flavors XSLT 1.0 and XSLT 2.0. It itself is written using XML.
  2. XPath 1.0 and XPath 2.0 – A DSL for querying information from a XML Tree, usually a DOM.
  3. XML Schema – a DSL for describing XML Validation. Written using XML.
  4. RelaxNG – Another DSL for describing XML Validation and content. Comes in both an XML based syntax and a Human Readable Compact Syntax.
  5. XPointer – a XML DSL for specifying the location of information with a document.
  6. XInclude – a XML DSL for specifying how to include or import information into existing XML documents.
  7. Web Services – A whole family of DSLs describing how to create web service implementations.
  8. SchemaTron – Yet another XML Validation DSL for validating XML files.

XML has made creating a DSL very simple and straight forward. It however is often used for the wrong reasons.

Which brings me to XText. I’ve been experimenting with it for a couple of days, and like XML it provides great power at little upfront cost. However, I also think like XML it can run into being applied way to often just because it is easy to create and deploy. XText itself has it’s own DSL for describing the languages, however, I wish it would have just leveraged an existing established standard language like the ISO EBNF.

So how many more DSLs will we create? More than we really need.

This entry was posted in eclipse, xml, xtext. Bookmark the permalink.

2 Responses to >The Latest HOT Term

  1. rod says:

    >I agree with you regarding leveraging "an existing established standard language" – ISO EBNF. The Xtext team no doubt had their reasons. The OAW team have often done their own DSL rather than use standards – e.g. Xtend : OCL/QVT-like but not OCL/QVT, Xpand as an alternative to OMG M2T.But overall why make an example of Xtext specifically? It's "just" textual DSL syntax (and quite an achievement for a 0.7 project; I'm looking forward to it's future development). To follow your line or argument, you could just as easily question GMF and EMF for making it easy to create DSLs and associated tools.

  2. David Carver says:

    >@rod Actually, I'm not picking on XText I'm comparing it to what XML has enabled in some way and the way XML made it very easy to create a slew of XML based DSLs. The very fact that it is easy to use is also it's potential problem as well. DSLs are necessary, but the popular thing right now is to try and push a DSL over another solution which may be more viable.I like XText and want it to do well, especially since I'm choosing it for part of the RelaxNG project I'm working on.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s