Why I hate XML for DSLs
theschemeway.blogspot.com
Why I hate XML for DSLs
1–10 of 27 posts
Re: Why I hate XML for DSLs
#2For some things, a visual DSL like a callflow for voice apps or musical notation for music probably has the highest information density, and therefore becomes the most pleasing interface for being creative.
Re: Why I hate XML for DSLs
#3The other is transforming XML documents (XSL) although this is quickly becoming more of a PITA than doing it natively as the various XML APIs start offering declarative syntaxes.
Re: Why I hate XML for DSLs
#4The closest I've come to writing an XML-like DSL are the many Lisp-lites that I've hacked up over the years. Most of the rest are either Forthish languages (if it's primarily for my use to avoid writing large quantities of Java, C*, Haskell, etc.) or rough "business natural language" DSLs for power users who want to tweak a process, object, or flow.
In general, I wouldn't even consider XML as a DSL unless I broaden my idea of a "DSL" to mean "any representation of a state or set of operations used by a computer," in which case I've written a lot of XSDs for machine-generated documents, such as serialized objects, messages to be placed on ESBs or queues, etc. But I do not think this article pertains to that sort of "language" either.
Re: Why I hate XML for DSLs
#5Re: Why I hate XML for DSLs
#6If you liked this blog post, you'll love mine on "Why I Hate Peanut Butter as a Cleaning Agent".
Re: Why I hate XML for DSLs
#7Re: Why I hate XML for DSLs
#8I have to say that I've never considered using an XML for a DSL. Most of the reasons I've written DSLs usually involve a desire to avoid writing more code. The closest I've come to writing an XML-like DSL are the many Lisp-lites that I've hacked up over the years. Most of the rest are either Forthish languages (if it's primarily for my use to avoid writing large quantities of Java, C*, Haskell, etc.) or rough "busine…
I'd like to ask a favor as a fellow programmer: pretend you never saw this article. The fewer XML-based DSLs, the better.
Re: Why I hate XML for DSLs
#9There are two times when you'll be better of programming in XML. One is if the language you would otherwise be writing in is Java. (Or WCF in the MS stack) The other is transforming XML documents (XSL) although this is quickly becoming more of a PITA than doing it natively as the various XML APIs start offering declarative syntaxes.
I admit that I've never done any serious Java development, but that's jumping from the kettle into the fire, is it not? As verbose as Java is, it seems to be less so than XML would be.
Re: Why I hate XML for DSLs
#10I have created a programming language that is written in XML. With a decent editor (I use oxygen xml) and a good schema (I use Relax NG) there is almost no way to make syntax errors and typing is a breeze (auto completion). With schematron you can even make clever (semantic) error checking before compile time. So it always depends on the case.
In short, don't risk your or your coworkers' safety. Just say no to XML as a programming language.