Version française
Home     About     Download     Resources     Contact us    
Browse thread
Long-term storage of values
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Long-term storage of values
On Fri, Mar 21, 2008 at 02:37:28PM +0000, Dario Teixeira wrote:
> If I remember correctly, the model with XDR+rpcgen is that the data type
> is defined in a special XDR notation, which ocamlrpcgen will then use to
> generate the Ocaml type and the (de)serialisation functions.

That's right.  You write a '*.x' file and it gets converted to C by
rpcgen or to OCaml by ocamlrpcgen.  There's a very lengthy example I
wrote below.  XDR is regarded as a rather "old" protocol and support
is somewhat limited (basically, C, Java and OCaml).  On the other hand
it is well-understood and miles faster than anything else, since it's
a simple marshalling format just like OCaml's Marshal.

http://git.et.redhat.com/?p=libvirt.git;a=blob_plain;f=qemud/remote_protocol.x;hb=HEAD

> Though XDR
> offers a fairly rich type set, it's not quite as versatile as Ocaml's.
> I just wonder if this will lead to situations where one would rather
> write the (de)serialisation functions by hand instead of relying on
> the poorer expressiveness of the automatic generators.

The limited type set is an advantage if you're sharing data with other
languages (or if you're using C), but a disadvantage otherwise.

> Btw, do you have any numbers concerning XDR performance?  My guess
> is that this would be the fastest method after Marshalling.

There's a really tiny table at the end of this document, comparing it
to XML so not really any competition:

http://et.redhat.com/~rjones/secure_rpc/

Rich.

-- 
Richard Jones
Red Hat