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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 20497BC6B for ; Fri, 25 Jan 2008 05:16:32 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq4HABLxmEfAXQImh2dsb2JhbACCNY1vAQEBCAopnmQ X-IronPort-AV: E=Sophos;i="4.25,247,1199660400"; d="scan'208";a="7202548" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 25 Jan 2008 05:16:31 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m0P4GVlB028459 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 25 Jan 2008 05:16:31 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq4HABLxmEfUnw6Flmdsb2JhbACCNY1vAQEBAQcEBgcKEQeeZA X-IronPort-AV: E=Sophos;i="4.25,247,1199660400"; d="scan'208";a="6551251" Received: from pih-relay06.plus.net ([212.159.14.133]) by mail2-smtp-roc.national.inria.fr with ESMTP; 25 Jan 2008 05:16:31 +0100 Received: from [80.229.56.224] (helo=beast.local) by pih-relay06.plus.net with esmtp (Exim) id 1JIFzS-00054v-Fi for caml-list@inria.fr; Fri, 25 Jan 2008 04:16:30 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@inria.fr Subject: Re: [Caml-list] Working around the brittle bindings problem Date: Fri, 25 Jan 2008 04:10:35 +0000 User-Agent: KMail/1.9.7 References: <200801242140.06785.jon@ffconsultancy.com> <20080125.113113.104032782.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20080125.113113.104032782.garrigue@math.nagoya-u.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801250410.35323.jon@ffconsultancy.com> X-Plusnet-Relay: 3630c180dff112dca05909d78d843757 X-Miltered: at discorde with ID 4799629F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bindings:01 functor:01 ocaml:01 compiler:01 compiler:01 cmi:01 doable:01 frog:98 wrote:01 caml-list:01 functions:01 functions:01 dependency:01 modules:02 argument:02 On Friday 25 January 2008 02:31:13 you wrote: > This looks like a good idea. This way you can choose the set of > functions you depend upon. This means essentially copying and > trimming down mlis. Then you just need to provide the source code for > the linking bits, that is a big functor application. > > This would protect you from checksums changing due to the addition of > new functions, or from compatible changes in function types (i.e., > types are equal according to ocaml expansion rules). This will not > protect you from a real change in function type at the interface (like > the addition of a new tag in a type, or of an extra optional > argument), or from a change in the compiler itself. > If you want maximal protection, you should apply the same approach to > standard library modules too, so that compiler changes that do not > alter the .cmi format would be allowed, but this is going to be painful. > There may also be a performance hit as the function calls get a bit > more costly (this should only matter for really fast functions, not > for openGL calls). Awesome! I'll try to get this done ASAP. I think I'll leave the dependency upon the compiler because it would be too painful to remove, as you say, but the rest should be doable and will make my recompilation nightmares a thing of the past! I'll post back with my findings... :-) -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e