English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

Browse thread
Best way to choose an implementation of a lib ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-12-01 (19:48)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] How to compile different implementations of the same lib
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


Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com