Geek Baiting for Fun and Profit

Curious to hear people’s thoughts on this assertion:

SOAP is an internal DSL of XML.

According to my favorite DSL check-list, it’s not a DSL. That matches with my gut, yet I’m having trouble coming up with a real justification for why not.

Related posts:

  1. Ghosts of predicitions past (or, self flagellation for fun and profit)
  2. Why I Love Geek Shops
  3. Music, Geek Stuff, and Princeton
  4. High Water Mark for Geek Humor?
  5. If You’re Thinking It’s Just Fun and Games
This entry was posted in Programming Language Punditry. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • http://hamletdarcy.blogspot.com Hamlet D\’Arcy

    I hate to come out too strongly, but that assertion is ridiculous. XML is one possible format for the message bodies of SOAP, albeit a common one. SOAP is an “envelope” around a message but does not provide any sort of abstraction of that message.

  • http://www.smokejumperit.com Robert Fischer

    Sure, and when I say “SOAP”, I really mean the soap envelope.

    The underlying question is whether the XSD defining SOAP defines a DSL, and if not, why not?

  • http://http Assaf

    a) No, it’s not a language. Computer languages are used for writing programs or algorithms. The SOAP XSD provides no guidance or constraints for a language, only for use as a wire protocol.

    b) There’s no domain. SOAP was designed to be a general purpose carrier of general purpose headers (security, transactions, etc) with a (possibly) domain specific body (orders, quotes, etc).

  • http://www.smokejumperit.com Robert Fischer

    a) I used to think that way, too, but it doesn’t really hold water. Declarative languages are languages, too: regex, for instance, is certainly a programming language. And the rise of (predominantly) declarative DSLs would have to be rejected as languages, too (DS_s?).
    b) Communicating web service requests isn’t a domain? Sure, it’s a pretty broad domain, but it’s still a domain.

  • http://labnotes.org Assaf

    Regex expresses an algorithm for extracting text strings. You can use SQL to express algorithm for extracting from (possibly even transforming) from a large data set. Computer languages, like these two, can definitely be declarative, but not all declarative expressions are computer languages.

    Back in the 90′s you get a lot of domain-specific protocols — RosettaNet, SWIFT, ACCORD, etc — each doing the general protocol parts in slightly different and incompatible ways. You end up paying top dollar for EAI to work around that problem. Then comes SOAP with the premise of a general purpose protocol, on top of which you can layer these domain specific protocols.

    Web services is a domain, but then, so is system programming: does that make C/C++ domain specific languages?

    In the world of protocols, SWIFT is domain specific because it specializes in banking, while RTSP specializes in streaming multimedia. SOAP wants to carry anything, everywhere, at all times. If you look at the works of the various standard groups, SOAP always resisted being limited in scope.

  • http://www.smokejumperit.com Robert Fischer

    Regex and SQL don’t express an algorithm: a given regex or SQL call could be (and are) implemented through multiple different algorithms. Both declare a pattern over data that is matched, and leave the algorithm for the implementation to decide.

    More interesting, though, is your (implicit) argument that a domain can’t be too general for a DSL, and that web service transport is on the “too broad” side of that boundary. Going to have to think about that one a bit: curious to think about what defines that boundary.

  • http://labnotes.org Assaf

    Regexp and SQL both express abstract algorithms. When you look at an SQL SELECT and go in your head “this will find all the companies in CA, join with employee that is CEO, and return their base salary”, you’re analyzing that abstract algorithm. Sometimes it’s identical to the algorithm chosen by the query analyzer (itself an algorithm that turns textual statements into query plans), sometimes only equivalent.

    Same thing with Regexp: “/foo\s*bar/ will stop at the first ‘foo’ that is followed by any number of whitespace characters and then followed by bar”. In reality the engine may start working from the end backwards, or a quantum regexp machine could evaluate all matches at once. Regardless, we’re only concerned with abstraction at the level of the Regexp expression, and clearly there’s a canonical algorithm you can derive from any given expression.

  • Marc Stock

    I’m going to side with Hamlet on this. The assertion is more than far fetched.

    DSLs are executable, XML is not. XML is simply easily parsed formatted text which is essentially no different than a formatted Word document (although much uglier). Would you assert that a Word document is a DSL? While Ant scripts are processed as executable XML, you could make a weak argument for such scripts as a DSL but SOAP envelopes have no such quality.

    Finally, XSD is merely a templating mechanism that can (although not necessary) be enforced by the consumer of the XML.

  • Brian

    It’s not a DSL, it’s a wire protocol. How good of a wire protocol is a different debate.

    Well, there was a short-lived SOAP programming language back in the 60′s, IIRC, but I don’t *think* that’s what you’re talking about.

  • Brian

    Aha, here we go. SOAP was the Symbolic Optimal Assembly Language for the IBM 650 computer.

    See, I knew SOAP was a programming language! And, it’s sad that I knew that.

    The problem isn’t finding a good name for a computer language, the problem is finding a good name for a programming language that hasn’t already been taken. But that’s a different discussion.

  • http://www.smokejumperit.com Robert Fischer

    @Marc

    “DSLs are executable” — interesting. So you’re asserting only internal DSLs are valid? If not, what does it mean for something to be “executable”? How are SQL and regex and the Grails Log4J DSL “executable”, and how is the SOAP envelope not?

    @Assaf

    What definition are you using for algorithm? Maybe I’ve just read too much Knuth, but I define an algorithm as a finite set of deterministic instructions. By that definition, “the first ‘foo’ that is followed by any number of whitespace characters and then followed by bar” is not an algorithm. Regex and SQL don’t define algorithms: they define patterns of data. *Finding* that pattern in a set of data requires an algorithm, and can be done any number of different ways, any of which is equally valid: I explicitly disagree that there’s an innate “canonical algorithm” implied by a given regex or SQL query.

    @Brian

    SOAP is also a series of characters. I’m not sure it being one thing precludes it from being another.

  • Marc Stock

    By executable I mean that it’s something that is compiled into either a set of executable machine instructions or into bytecode that is executable by a virtual machine. Either way it’s ultimately translated into machine instructions. So your next question would probably be something like, “Why wouldn’t an Ant script be more or less the same as a .class file?” The answer is that an Ant script is never translated into a set of machine instructions. Ant’s code is translated into machine instructions (via bytecode) but the script it’s executing never is. It’s always just data. To your point about SQL and regex, I’m not sure about SQL since I don’t know how it’s processed internally by a database (but I’d guess it doesn’t qualify) but regex certainly wouldn’t qualify as a DSL. Regex is rigorously formatted text, however there’s no language to speak of. Don’t confuse language with computer language. Computer languages are executable, others are not.

    And yes arguably these are semantic differences but so are all the other rules that define what is and isn’t a DSL :)

  • http://www.smokejumperit.com Robert Fischer

    @Marc

    How is Ruby executable under your definition, but regex isn’t? Or is Ruby not a language, either?

  • http://labnotes.org Assaf

    a) not limiting it to deterministic steps (check Wikipedia, apparently there are two camps as far as deterministic goes). but otherwise not much different.

    b) foo\s*bar means “scan until you reach the sequence foo, which is directly followed by sequence of whitespace …”. and I could be much more specific to the point where a mechanical turk could do it or an Intel 8008. It’s a very specific set of instructions (with conditions and branching) expressed by that pattern.

    I can’t think of a regexp that’s not an algorithm in of itself.

  • Marc Stock

    Lol, when I was typing my previous post, I was considering adding in something along the line of “if an AST is part of the process, you get to be a language too”. However, I’m just spit-balling here since most people intuitively know what a language is (DSL or otherwise) but how do you put a dictionary definition on it. It gets complicated since if you look hard enough you can probably find an exception to the rule (unless your rule list is truely exhaustive). Perhaps a better way to do it is to just use duck typing as an example where if it looks like, acts like, and sounds like a language, then it is. It’s safe to say that SOAP and Ant scripts fail the duck typing test, whereas Ruby passes with flying colors.

  • Categories