From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 1330CBBCA for ; Fri, 21 Mar 2008 16:24:10 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4CALRv40dQRFuwdGdsb2JhbACRDgGZCw X-IronPort-AV: E=Sophos;i="4.25,536,1199660400"; d="scan'208";a="24047173" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 21 Mar 2008 16:24:09 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1Jcj6G-0007xB-RE; Fri, 21 Mar 2008 15:24:08 +0000 Date: Fri, 21 Mar 2008 15:24:08 +0000 To: Dario Teixeira Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Long-term storage of values Message-ID: <20080321152408.GB29482@annexia.org> References: <1206049386.3295.18.camel@flake.lan.gerd-stolpmann.de> <905079.47901.qm@web54602.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <905079.47901.qm@web54602.mail.re2.yahoo.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; model:01 notation:01 ocaml:01 ocaml:01 marshalling:01 ocaml's:01 ocaml's:01 marshalling:01 git:98 git:98 wrote:01 wrote:01 caml-list:01 functions:01 functions:01 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