[Planetlab-arch] XML-RPC spec

Joe Armstrong joe at sics.se
Thu Mar 11 10:32:56 EST 2004


On Thu, 11 Mar 2004, Steve Muir wrote:

> Joe,
> 
> i'm certainly not going to stand up and say that XML-RPC is the greatest
> thing in the world, far from it.  but the protocol details are supposed to
> be irrelevant - as scott said, there are nice XML-RPC interfaces for all
	                                   ****

The problem is that they are not nice.

> the popular scripting languages that take care of all the marshaling and
> unmarshaling and let me use a function call without caring about the
> underlying XML.  yes, you can send a chunk of XML directly to the server,
> but that's not how you're supposed to use the interface, just like i CAN
> telnet to port 25 on any SMTP server and type a bunch of commands in order
> to send mail, but that's not how people generally use it. 

That's because the port 25 SMTP protocol is not designed to be user friendly

Suppose I sent mail like this:

	telnet 25
	> (mail 'joe at sics
	'(Hi joe
        how's life))
	^D

Then it *would* be easy. Now sure, we can hide the details of a
verbose interface in a GUI of something - but IMHO the underlying
protocol should be the simplest possible to parse and read. Even if we
do use a tool to hide the complexity.

Unfortunately virually every RFC defines a different ad hock protocol -
if the first RFC had used a lisp syntax (or ANY formal compact syntax)
and if everybody had followed suit then life would be a *lot* easier.

The benefit of XML/XML-RPC is you only need to write the
parser once etc ...

The downside is that XML itself is incredably verbose - the same
net effect can easily be achieved with a formal sytax that is easy to parse
and easy to read and write. That way you get the best of both worlds for
free.

> to be an XML-RPC library for C here:
> 
> http://xmlrpc-c.sourceforge.net/
> 
> if you want to use the API from a shell script then the easiest way is
> probably just to call one of the Perl or Python wrapper scripts; you don't
> need to speak those languages in order to use the scripts.
> 
> what would you prefer us to use instead of XML-RPC? 

UBF (see the plug below)

<aside>
ssh

Instead of *installing* python on my machine and the python libraries
and the slicetools package and ...

I could just use ssh and issue the command:

   ssh planetLabControlMachine addnode ....

That way involves zero installation effort at my end (I just need ssh)
You then only have one copy of slicetools around which makes keeping things
up-to-date etc easier :-)

   I'd just send you all my admin commands for remote execution -
this *is* how you do it with the web interface after all.

</aside>

  You  could  use   *any*  symbolic  language  -  just   send  a  list
S-expression a prolog term etc.

  Example:  Suppose you  want  to  do an  addnode  operation to  slice
sics-23 adding the  nodes aa.bb.cc and dd.ee.ff supose  my account and
password are joe at sics.se and mypass then I'd just do this:

	open a secure socket to port 433
	and send it

   <<{addNodes, "sics_23", ["aa.bb.cc","dd.ee.ff"], "joe at sics.se", "mypass"}>>

   Everything between << and >> is a string literal

   Here I've sent an Erlang term - could easily be LISP

    (addNodes 'sics_23 '("aa.bb.cc" "dd.ee.ff") 'joe at sics.se 'mypass)

   The point being to raise the abstraction level in the interface

<aside>
(and shameless plug) - use my UBF (see http://www.sics.se/~joe/ubf)

Simply speaking, UBF is a contract language that allows one to
make statements like:

   if you sent me a term of this type I'll promise to sent you a term
   of this type back.

I intend to build a build a network of UBF servers on planet lab and provide
a load of UBF plug-ins for distributed hash tables, authentication etc.
 
</aside>

Cheers

/Joe

  BTW -  Planet lab is fun -  raises a lot of  interesting questions -
how to we store stuff - how do we find stuff ....





More information about the Arch mailing list