From: malc <malc@pulsesoft.com>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: daniel.buenzli@epfl.ch, caml-list@inria.fr
Subject: Re: [Caml-list] How to compile different implementations of the same lib
Date: Thu, 1 Dec 2005 04:53:43 +0300 (MSK) [thread overview]
Message-ID: <Pine.LNX.4.61.0512010452220.12149@home.oyster.ru> (raw)
In-Reply-To: <20051201.100719.07647797.garrigue@math.nagoya-u.ac.jp>
On Thu, 1 Dec 2005, Jacques Garrigue wrote:
<snip>
> Yes, that's the idea.
> I should have been more specific:
> In order to create a clean separation between the library and the
> client, such that you will be able to change the implementation of the
> library, you must write .mli's for all the modules the library
> exports, and compile the client with only the .cmi's in the path.
> Note of course that the .mli/.cmi must also be copied to the directory
> where you compile the library (the compiler only looks for them there
> when compiling the .ml).
>
> A result is that there cannot be any inlining between client and
> library. Actually, this is even worse than that: this also prevents
> direct function calls, as the concrete information about functions is
> also in the .cmx. All calls will have to go through closures. Just
> like when you call a function received as parameter, or inside a
> functor.
A long while ago i wrote an unliner for .cmx to fight precisely this
problem, was quite trivial too, not that i ever understood the full
implications of this ofcourse.
>
> This suggests the other evident alternative: write the client as a
> functor. This will not be slower! But this can be more painful if
> there are several modules in the client...
--
mailto:malc@pulsesoft.com
next prev parent reply other threads:[~2005-12-01 1:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-30 9:05 Best way to choose an implementation of a lib ? Christophe Raffalli
2005-11-30 12:19 ` [Caml-list] " Jacques Garrigue
2005-11-30 14:38 ` How to compile different implementations of the same lib Daniel Bünzli
2005-11-30 16:09 ` [Caml-list] " Daniel Bünzli
2005-12-01 1:07 ` Jacques Garrigue
2005-12-01 1:53 ` malc [this message]
2005-12-01 17:03 ` Christophe Raffalli
2005-12-01 17:54 ` skaller
2005-12-01 20:09 ` Richard Jones
2005-12-01 23:47 ` skaller
2005-12-02 3:29 ` Jacques Garrigue
2005-12-01 21:33 ` Christophe Raffalli
2005-12-02 3:06 ` Jacques Garrigue
2005-11-30 16:24 ` how to detect .cmx incompatibility Stefano Zacchiroli
2005-11-30 19:48 ` [Caml-list] Best way to choose an implementation of a lib ? Eric Cooper
2005-12-01 17:05 ` Christophe Raffalli
2005-12-01 17:31 ` Eric Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0512010452220.12149@home.oyster.ru \
--to=malc@pulsesoft.com \
--cc=caml-list@inria.fr \
--cc=daniel.buenzli@epfl.ch \
--cc=garrigue@math.nagoya-u.ac.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox