From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id DDB6C7EE51 for ; Mon, 15 Apr 2013 11:16:27 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of christophe.raffalli@univ-savoie.fr) identity=pra; client-ip=193.48.126.73; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christophe.raffalli@univ-savoie.fr"; x-sender="christophe.raffalli@univ-savoie.fr"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of christophe.raffalli@univ-savoie.fr designates 193.48.126.73 as permitted sender) identity=mailfrom; client-ip=193.48.126.73; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christophe.raffalli@univ-savoie.fr"; x-sender="christophe.raffalli@univ-savoie.fr"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@dsi-mta-out.univ-savoie.fr) identity=helo; client-ip=193.48.126.73; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christophe.raffalli@univ-savoie.fr"; x-sender="postmaster@dsi-mta-out.univ-savoie.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoIBAAXEa1HBMH5JnGdsb2JhbABQFoMmwgkWDgEBAQEBCAsJCRQogk0iDCMuDxYYAwIBAgE3FA0GAgEBF4d9CJo3oEONZYR6A49UgSmMDY4ZgXE X-IPAS-Result: AoIBAAXEa1HBMH5JnGdsb2JhbABQFoMmwgkWDgEBAQEBCAsJCRQogk0iDCMuDxYYAwIBAgE3FA0GAgEBF4d9CJo3oEONZYR6A49UgSmMDY4ZgXE X-IronPort-AV: E=Sophos;i="4.87,474,1363129200"; d="asc'?scan'208";a="13286064" Received: from dsi-mta-out.univ-savoie.fr ([193.48.126.73]) by mail2-smtp-roc.national.inria.fr with ESMTP; 15 Apr 2013 11:16:27 +0200 Received: from localhost (localhost [127.0.0.1]) by dsi-mta-out.univ-savoie.fr (Postfix) with ESMTP id 62F75300B6 for ; Mon, 15 Apr 2013 11:16:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at dsi-a177.univ-savoie.fr Received: from dsi-mta-out.univ-savoie.fr ([127.0.0.1]) by localhost (dsi-mta-out.univ-savoie.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JQ1Blue6NUmO for ; Mon, 15 Apr 2013 11:16:27 +0200 (CEST) Received: from dsi-mail-msa1.univ-savoie.fr (dsi-mail-msa1.univ-savoie.fr [193.48.126.83]) by dsi-mta-out.univ-savoie.fr (Postfix) with ESMTP id 4DF8430066 for ; Mon, 15 Apr 2013 11:16:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by dsi-mail-msa1.univ-savoie.fr (Postfix) with ESMTP id 495B81C084; Mon, 15 Apr 2013 11:16:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at dsi-mail-msa1 Received: from dsi-mail-msa1.univ-savoie.fr ([127.0.0.1]) by localhost (dsi-mail-msa1.univ-savoie.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wMMesapm4TvJ; Mon, 15 Apr 2013 11:16:27 +0200 (CEST) Received: from [193.48.123.45] (d45.lama.univ-savoie.fr [193.48.123.45]) by dsi-mail-msa1.univ-savoie.fr (Postfix) with ESMTPS id 3338C1C07A; Mon, 15 Apr 2013 11:16:27 +0200 (CEST) Message-ID: <516BC56B.7090903@univ-savoie.fr> Date: Mon, 15 Apr 2013 11:16:27 +0200 From: Christophe Raffalli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Caml List X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2OGFCVKLIGHLGXJSEMIHI" X-Validation-by: christophe.raffalli@univ-savoie.fr Subject: [Caml-list] Closures serialization and hash. This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OGFCVKLIGHLGXJSEMIHI Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hello, The usual limitation of serialization and hashing of closures is sometimes = painful, especially with the current temptation of parallelisation. I am involved in two projects/so= fwares that are impacted by this: bindlib[1] (where data structure using bound variables uses closur= es) and Patoline[2] (where documents using animation and compiled with the "Bin" driver contain= closures). There is a simple way out of this problem, at least for libraries where the= function pointer in closure can be predicted enough : - use a table associating function "names" (position in the .cmo, or the = lambda-tree or anything portable) to source code adresses. The function name should be portable acr= oss architecture and distinct binary using common librairies. - (1) fill this table by calling a function "register_code_pointer : ('a -= > 'b) -> unit" - (2) or even better offer a linking option to register all closures from = some compilation unit. With this, serialisation and hashing functions could use those "names" inst= ead of addresses. Thus we would have reproducible hash and portable serialization for registered func= tions in closure. I will probably try this soon by adding custom version of Hash and Marshal = to bindlib using (1) ... But support from real OCaml giving (2) would be much better. So my question is : are you ennoyed by this problem, and, if yes, would you= be happy with the above solutions. Cheers, Christophe [1] http://www.lama.univ-savoie.fr/~raffalli/bindlib [2] http://www.patoline.com --=20 Christophe Raffalli Universite de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tel: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net --------------------------------------------- ------enig2OGFCVKLIGHLGXJSEMIHI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlFrxWsACgkQi9jr/RgYAS6PMQCgqt23N5DqSpMajlMsakBEQNw1 qiMAoI4umLNZXBEjNbWu3jKzB9yN/ioK =bYiy -----END PGP SIGNATURE----- ------enig2OGFCVKLIGHLGXJSEMIHI--