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=3.0 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,DNS_FROM_SECURITYSAGE, RCVD_IN_NJABL_PROXY autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id E2167BBB7 for ; Fri, 24 Oct 2008 00:21:04 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4AAG+VAEnOvjGvkWdsb2JhbACTbwEBAQEJCwoHEQOlfYhNBQIBg0s X-IronPort-AV: E=Sophos;i="4.33,473,1220220000"; d="scan'208";a="18437372" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Oct 2008 00:21:04 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m9NML4hF032541 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 24 Oct 2008 00:21:04 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4AAG+VAEnOvjGvkWdsb2JhbACTbwEBAQEJCwoHEQOlfYhNBQIBg0s X-IronPort-AV: E=Sophos;i="4.33,473,1220220000"; d="scan'208";a="18437370" Received: from web54605.mail.re2.yahoo.com ([206.190.49.175]) by mail3-smtp-sop.national.inria.fr with SMTP; 24 Oct 2008 00:21:03 +0200 Received: (qmail 13422 invoked by uid 60001); 23 Oct 2008 22:21:02 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=zbWkt6eToJo0t9bVm3yzKHPOwqTIDdgVBtbksgB8zFf+xkQOnkQoweBHeGXpfCpj9l4qO27iAgVI8szXkHhAu2AyLu4gps7Eq6p56mWLAHTb/bsTES7+cEzeIk720lBM+paZV5/KWb1RXqd2U7QaGu5+AM62+O4vCWXknhXYxZU=; X-YMail-OSG: M7fLkkMVM1nf_WlPTPVTNd9Q8vJbsl3O851OIEtS.dklRy.hJ6n3U8FZ2Bo2V_2hN4jS8oy8mLky9zH_Uj2kHNWdO3LCYCh8D68rvnZ7SduYYQUilBxiSlo9D1N1eiqYo8GNKPyizA.FnLl4RWiALlE2l7iOXpi3Dy7PjGSJ Received: from [213.205.70.208] by web54605.mail.re2.yahoo.com via HTTP; Thu, 23 Oct 2008 15:21:01 PDT X-Mailer: YahooMailWebService/0.7.247.3 Date: Thu, 23 Oct 2008 15:21:01 -0700 (PDT) From: Dario Teixeira Subject: Re: [Caml-list] Re: Serialisation of PXP DTDs To: caml-list@inria.fr, Mauricio Fernandez In-Reply-To: <20081023210527.GB32611@NANA.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <278256.11946.qm@web54605.mail.re2.yahoo.com> X-Miltered: at concorde with ID 4900F8D0.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; pxp:01 dtds:01 compiler:01 ocaml:01 ocaml:01 haskell:01 syntax:01 syntax:01 sexp:01 entail:01 compiler:01 ocaml's:01 camlp:01 cheers:01 preprocessor:01 Hi, > This protocol definition is fed to the compiler, which > generates the OCaml type definitions, as well as the=20 > encoders/decoders and pretty-printers (as you can see, > the specification uses a mix of OCaml, Haskell and C++ > syntax, but it's pretty clear IMO) Basically the XDR approach, but with a syntax inspired by more modern, functional languages, right? > It's not a drop-in solution like sexplib's "with sexp", > by design (since it is meant to allow interoperability between > different languages), but it's still fairly easy to use. Personally, I think that a sexplib-like syntax extension is the killer feature for serialisation libraries, and the reason why I was immediately swayed by sexplib. However, writing a sexplib-like syntax extension for your serialisation library would entail solving the reverse problem now handled by your compiler. This might not always be possible because some features of Ocaml's type system might not map neatly into your format. Nevertheless, the sheer convenience of the syntax extension approach makes it worth while having, even if on occasion the preprocessor were to produce an error message stating that it could not convert a certain structure. For reference purposes, you could even have the syntax extension output to an external file the inferred structure definition in your language format! (I know this would be a very complex project, but it does illustrate the power of Camlp4). Anyway, what you described looks very interesting. Keep us posted! Cheers, Dario Teixeira =0A=0A=0A