Real Domain Specific Languages vs. XML Pseudo-DSL’s
17 03 2007In my last post, I mentioned the fact that NSIS doesn’t use XML as a reason why I preferred it over WIX.
I think maybe I should explain that a little better.
There seems to be a popular thought in many circles that XML is a great way to represent Domain Specific Languages. It’s possible that Ant and NAnt have been largely responsible for this, although who really knows for sure. I’m certainly not against using XML when it makes sense. XML can be a great way to represent many kinds of data, and it makes storing and parsing data a relatively simple from a programming perspective. But the same structure that makes it easy for a computer to parse adds visual noise for humans trying to read it, not to mention type it.
If you want to use XML as a way to create a DSL without all the hassle of creating grammars and parsers, then go right ahead. Just be conscious of the fact that you’re trading ease of use for easier DSL development. But if you’re creating a DSL that will be used by many people over a long period of time, like WIX or NSIS, your users will be much better off if you take the time to come up with a suitable abstraction. Of course, if your target abstraction is a visual one, then it might make a lot of sense to go with XML.
Categories : dsl