caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
To: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Checking an interface against an implementation
Date: Mon, 5 Dec 2005 15:00:15 +0100	[thread overview]
Message-ID: <3C5A94D7-998F-4BE4-BC27-C6DDAC3C2620@epfl.ch> (raw)
In-Reply-To: <20051205114622.GB6870@furbychan.cocan.org>

Le 5 déc. 05 à 12:46, Richard Jones a écrit :

> I think the tool you're looking for is "objinfo" -- on Linux it's
> usually installed as "ocamlobjinfo".  However this tool only works on
> .cmi's or .cmo's, not .cmx's.

Thanks for the info (however note that this tool doesn't seem to be  
installed by default, at least if you compile from the source).

However I think what I want to do is impossible, apparently cmo  
record the cmi they were compiled with (in my case the one  
automatically generated) and refuse to link if the client was  
compiled with a different cmi. In other words a .cmo can have only  
one .cmi, is that true ?

One way to achieve what I want is to do the following

mylib/a.ml
mylib/b.ml
mylib/mylib.ml
mylib/mylib.mli

Such that mylib.ml is :

module A = A
module B = B

and mylib.mli defines the constrained interfaces :

module A = sig ... end
module B = sig ... end

But I have the following two questions. Suppose I pack the objects  
files into a cma and cmxa,

1) Is there any performance impact when the client uses functions  
from A or B via Mylib ? Does it introduce an indirection ?

2) Don't I lose the benefit of cm(x)a ? I have the impression that  
here, even if the client uses only functions from Mylib.A, b.cmo (or  
b.cmx) will also be linked in. Is that right ?

Daniel



  
  

      reply	other threads:[~2005-12-05 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-05 10:24 Daniel Bünzli
2005-12-05 11:46 ` [Caml-list] " Richard Jones
2005-12-05 14:00   ` Daniel Bünzli [this message]

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=3C5A94D7-998F-4BE4-BC27-C6DDAC3C2620@epfl.ch \
    --to=daniel.buenzli@epfl.ch \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).