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 9F5DF7EE51 for ; Mon, 15 Apr 2013 15:21:47 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.87,476,1363129200"; d="scan'208";a="13333413" Received: from wencory.loria.fr (HELO [152.81.3.42]) ([152.81.3.42]) by mail2-relais-roc.national.inria.fr with ESMTP; 15 Apr 2013 15:21:47 +0200 Message-ID: <516BFEEB.2060508@glondu.net> Date: Mon, 15 Apr 2013 15:21:47 +0200 From: =?windows-1252?Q?St=E9phane_Glondu?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130315 Icedove/17.0.4 MIME-Version: 1.0 To: Christophe Raffalli CC: Caml List References: <516BC56B.7090903@univ-savoie.fr> In-Reply-To: <516BC56B.7090903@univ-savoie.fr> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Closures serialization and hash. Le 15/04/2013 11:16, Christophe Raffalli a écrit : > - 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 across architecture and > distinct binary using common librairies. > > - (1) fill this table by calling a function "register_code_pointer : ('a -> 'b) -> unit" Instead of letting the compiler guessing a portable name, I'd rather give explicit names to code pointers. Like Callback.register in the FFI. You'd also get the possibility to maintain ABI stability. > - (2) or even better offer a linking option to register all closures from some compilation unit. I'm not convinced this is better. I don't think having the possibility to serialize /any/ closure is a good thing. IMHO, serialized functions are like exported functions in modules. Their stability should be guaranteeable at ABI level, which is not something you want for everything! Cheers, -- Stéphane