[plt-scheme] ipc among mzscheme processes

From: Neil W. Van Dyke (neil at neilvandyke.org)
Date: Sun May 11 01:51:55 EDT 2003

Shriram Krishnamurthi <sk at cs.brown.edu> writes at 22:57 10-May-2003 -0400:
> Neil, while I'm not exactly a *fan* of XML-RPC, your claim that it is
> a "non-use" is stronger than any I would have made.  Could you please
> explain the extreme part of that point of view?

"Non-use" is intentionally imprecise -- shorthand for my disappointment
when I looked into XML-RPC and found that made particularly poor use of
XML.  The following will sound a little glib and harsh, partly because
I'm writing on a Saturday night...

People can see for themselves the entirety of the language and its use
of XML by looking at the informal spec at "http://www.xmlrpc.com/spec"
(don't worry, it's very short).

Yes, you *can* parse it with an XML parser (at least once you create a
DTD for XML-RPC, since the spec doesn't actually have one, and you add
the appropriate directive).  Then you have to traverse or query the tree
to get at what is essentially a very simple list describing exactly one
function application.

A read of the spec shows that the language is so limited that the use of
XML syntax cannot afford any flexibility, and only obfuscates.  Their
example:

    <methodCall>
       <methodName>examples.getStateName</methodName>
       <params>
          <param>
             <value><i4>41</i4></value>
          </param>
      </params>
    </methodCall>

Conveys no more information than:

    (examples.getStateName 41)

A look at the rest of their language shows that it's not just this
example that reduces to simple familiar Lisp sexps.

The truism among some Lispers that XML is nothing but ugly sexps is not
all that true, since the whole of XML comprises quite a lot of semantic
definition and even useful syntactic structure and encoding beyond what
sexps give us.  But XML-RPC is the poster-child for the
XML-is-just-ugly-sexps movement.

If we really wanted to use XML for RPC, an appropriate use (for the call
language, which is what XML-RPC spec defines) would be to send messages
in terms of the resource's language (each resource should really be
described by a DTD or XSL, but we can also do it ad hoc like XML-RPC
does, and we'll even name our parameter):

    <examples:getStateName><foo>41</foo></examples:getStateName>

Or:

    <examples:getStateName foo="41" />

Then we realize that these messages can now speak in terms of complex
data structures described by XML DTDs and schema. Indeed that the data
we want to query and mutate with thes messages should in fact already be
described in terms of XML.  And we are reminded this is the point of XML.

I see no justification for the use of XML syntax in XML-RPC, other than
to be the first person to landgrab the primo buzzword name "XML-RPC".

(I could've penned a more impassioned screed denouncing XML-RPC when I
looked at it last year, but I've had a chance to cool off. :)

-- 
                                             http://www.neilvandyke.org/


Posted on the users mailing list.