caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dmitry Bely <dbely@mail.ru>
To: caml-list@inria.fr
Subject: Re: [Caml-list] No unused code linking?
Date: Fri, 11 Nov 2005 18:29:54 +0300	[thread overview]
Message-ID: <y83vdwy5.fsf@mail.ru> (raw)
In-Reply-To: <Pine.LNX.4.61.0511091540001.1280@home.oyster.ru> (malc@pulsesoft.com's message of "Wed, 9 Nov 2005 15:44:01 +0300 (MSK)")

malc <malc@pulsesoft.com> writes:

>> IMHO, each header item can be placed into the separate DATA section, so
>> it's not the real problem (the frame table is).
>
> No it can not. The moduler header must be contiguous and not rearranged by
> linker. In absence of .cmx (and name -> mangled name table) OCaml uses the
> header to call functions by position. Thus, as it is now, no part of
> header can be eliminated, which in reality means that almost everything,
> from linkers perspective, is reachable and can not be removed by
> --gc-functions.

>>> All in all this would require quite an effort in restructuring almost
>>> everything. I wouldn't count on it.
>>
>> Probably you are right, but I still hope for a miracle :-)
>>
> Right rigth, that's exactly what's required

As the Ocaml team people remain silent I am afraid your analysis is
correct. OK, we cannot easily do the job during the code generation but
maybe we can rearrange the source files? Say, if we have

[foo.mli]
val f1: ...
val f2: ...

[foo.ml]
let f1 = ...
let f2 = ...

could we transform them (with some camlp4-based source-level tool) to

[foo_f1.mli]
val f1: ...

[foo_f2.mli]
val f2: ...

[foo.mli]
open Foo_f1
open Foo_f2

[foo_f1.ml]
let f1 = ...

[foo_f2.ml]
let f2 = ...

Isn't it equivalent to the initial version but can be linked separately?

- Dmitry Bely


      parent reply	other threads:[~2005-11-11 15:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-09 11:11 Dmitry Bely
2005-11-09 11:19 ` [Caml-list] " malc
2005-11-09 11:49   ` Dmitry Bely
2005-11-09 12:44     ` malc
2005-11-11 13:41       ` Florian Weimer
2005-11-11 15:29       ` Dmitry Bely [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=y83vdwy5.fsf@mail.ru \
    --to=dbely@mail.ru \
    --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).