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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 4C014BB81 for ; Thu, 1 Dec 2005 20:48:00 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jB1JlxwM022800 for ; Thu, 1 Dec 2005 20:47:59 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA11038 for ; Thu, 1 Dec 2005 20:47:58 +0100 (MET) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jB1Jlvgc028538 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 1 Dec 2005 20:47:58 +0100 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1EhukS-0000bN-00; Thu, 01 Dec 2005 20:09:44 +0000 Date: Thu, 1 Dec 2005 20:09:44 +0000 To: skaller Cc: caml-list@inria.fr Subject: Re: [Caml-list] How to compile different implementations of the same lib Message-ID: <20051201200944.GA30251@furbychan.cocan.org> References: <20051130.211930.102965761.garrigue@math.nagoya-u.ac.jp> <4F70401E-AE91-4E5E-AF67-70FBDCC7C353@epfl.ch> <20051201.100719.07647797.garrigue@math.nagoya-u.ac.jp> <438F2CE5.9030105@univ-savoie.fr> <1133459647.9266.20.camel@rosella> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1133459647.9266.20.camel@rosella> User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at concorde with ID 438F536F.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 438F536D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 lib:01 christophe:01 raffalli:01 ocaml:01 cmx:01 cmi:01 cmx:01 ocaml:01 compilation:01 model:01 abstraction:01 indirection:01 notepad:01 wrote:01 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=none autolearn=disabled version=3.0.3 On Fri, Dec 02, 2005 at 04:54:07AM +1100, skaller wrote: > On Thu, 2005-12-01 at 18:03 +0100, Christophe Raffalli wrote: > > May be I still do not get the problem > > Simple. Ocaml cheats. When you *compile* against a cmx > or cmi/cmx pair, Ocaml 'cheats' and lifts non-interface > information out of the cmx. This allows it to, for > example, inline functions by cheating and grabbing their > implementations from the cmx. > > This 'cheating' is typesafe and transparent at the program > code level but NOT the compilation model level. > > To enforce abstraction, you have to ensure the cmx is > not present when the dependent module is compiled, > this forces the generated code to use indirection > (closures, etc) [...] I don't quite understand this. I get that if the .cmx isn't available, then one obviously cannot inline the code. But why is it that you cannot use a simple call instruction even if the .cmx isn't available? Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com