From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id B2FE1BB81 for ; Wed, 11 Jan 2006 05:48:44 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0B4mi6R011650 for ; Wed, 11 Jan 2006 05:48:44 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id FAA21352 for ; Wed, 11 Jan 2006 05:48:43 +0100 (MET) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.198]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k0B4mgCq032167 for ; Wed, 11 Jan 2006 05:48:43 +0100 Received: by zproxy.gmail.com with SMTP id x7so68315nzc for ; Tue, 10 Jan 2006 20:48:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dxRQnob2+6XAl+PiIM40uDWARYYGxQT0BrRxfR3/otP2IWKhQwcAPpvVeclBBxgRfHbS1u/uMzWLQePrPv/3VHUErlq9TwVN5ijTrLN667xtD2STBpfRQw29K+IUT81qqL3EM3UJ5rj4uGg2Vqm0Uf8GnNJi/p84dSPL/0P9V1o= Received: by 10.65.189.19 with SMTP id r19mr80333qbp; Tue, 10 Jan 2006 20:48:42 -0800 (PST) Received: by 10.65.22.19 with HTTP; Tue, 10 Jan 2006 20:48:42 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2006 17:48:42 +1300 From: Jonathan Roewen To: Mark Shinwell Subject: Re: [Caml-list] Pickling for OCaml? Cc: caml-list@inria.fr In-Reply-To: <20060106160207.GK5470@three-tuns.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20060106211605.6e0d2bd8.ocaml-erikd@mega-nerd.com> <43BE8E82.1000901@barettadeit.com> <20060106160207.GK5470@three-tuns.net> X-Miltered: at nez-perce with ID 43C48E2C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43C48E2A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 marshalling:01 runtime:01 marshalling:01 o'caml:01 sml:01 o'caml:01 bool:01 char:01 combinators:01 seq:01 mli:01 ath:98 ath:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 > > Marshalling and "pickling" are synonyms. The Marshal module does not > > provide runtime checks, yet, but the Caml team is working at it, as far= as > > I know. > > Myself and others at Cambridge, headed by Peter Sewell, are working on > type- and abstraction-safe marshalling for O'Caml that works even where > values to be marshalled are passed through polymorphic functions. > Expect to hear more later this year. Well, in the meantime, we've ported most of the pickling library from SML.NET to work with O'Caml. Supports most of the basic types (int,bool,char,string,list,array,unit,pairs->sextuples) and a few combinators (alttag, wrap, lift,seq). Fairly easy to define a pickler: module BytePickle =3D Pickle.CorePickle(Pickle.ByteCodec) open BytePickle let pickler =3D pair (string list,int) let data =3D pickle pickler (["hello";"world"],-1) let value =3D unpickle pickler (List.rev data) Files at http://devnulled.ath.cx/svn/dst/kernel/pickle.ml & http://devnulled.ath.cx/svn/dst/kernel/pickle.mli Kindest Regards, Jonathan