caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Chris Hecker <checker@d6.com>
To: brogoff@speakeasy.net, "caml-list@inria.fr" <caml-list@inria.fr>
Cc: Xavier Leroy <xavier.leroy@inria.fr>
Subject: Re: [Caml-list] Error during partial linking
Date: Tue, 22 Oct 2002 10:44:34 -0700	[thread overview]
Message-ID: <4.3.2.7.2.20021022103356.0361f910@mail.d6.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0210221008100.6093-100000@grace.speakeasy.ne t>


>like that, so that List, Array, etc., become Std.List, Std.Array, etc, as we
>do now for the labeled modules.
>I suppose it's too late now for such a change, but I'm pretty sympathetic to
>people who grouse over the fact that lots of good names are taken.

It's not too late for a change.  The standard library should be packed 
(resulting in the namespaces you mention above), and then a deprecated 
backwards-compatibility switch can be added to the compiler that does an 
"open Std" before everything, and that should just work (it should be 
inserted before the open Pervasives that's currently there).  You'll have 
to recompile everything, but you have to do that with ocaml version changes 
anyway.  :)

The big problem is linking all the unused code.

Hey, I just had an idea (which just came to me when I thought of the way I 
first attempted to make pack work on win32):  The problem with not linking 
unused code happens at the final link stage and is the c linker's 
fault.  Instead of having -pack make a merged .o (object) to correspond to 
the merged .cmx, it can make a .a (library).  objcopy can rename symbols in 
a library just as easily as in an object (it makes a temp dir and renames 
all the objs, then relibs them, I think...there is one tiny complication 
with the startup code which is totally solveable and I can go into it if 
anybody besides Xavier cares :).  So, you'll have a library that has 
separate objects in it, and those objects will have the nested scope on 
their identifiers.  The final link will resolve only the symbols it needs, 
and the linker will throw out all the other object files like it normally 
does with a library.

I think this will work portably and give all the features we want: 1) 
packing code and interface, 2) namespace nesting, 3) not linking unused code.

If I'm right, we can just throw everything in the standard library, 
including unix and bigarray and str and whatever, into a huge pack file, 
and you'll still only get the things you need (I assume caml is smart 
enough not to link functions from its side of the puzzle (the cmx) if 
they're not used...this solution only solves the external linker obj/lib 
situation).

Chris


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2002-10-22 17:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-22  5:33 Yang Shouxun
2002-10-22  8:42 ` Xavier Leroy
2002-10-22  9:21   ` Sven Luther
2002-10-22 16:17     ` Chris Hecker
2002-10-22 16:47       ` Sven Luther
2002-10-22 17:14     ` [Caml-list] on the -pack option Xavier Leroy
2002-10-22 19:30       ` Sven Luther
2002-10-22  9:37   ` [Caml-list] Error during partial linking Yang Shouxun
2002-10-22 16:07     ` Chris Hecker
2002-10-22 17:00       ` Xavier Leroy
2002-10-22 17:12         ` Chris Hecker
2002-10-22 17:21         ` brogoff
2002-10-22 20:06           ` Dmitry Bely
2002-10-22 20:25             ` Alain Frisch
2002-10-22 20:37               ` Dmitry Bely
2002-10-22 20:53                 ` Alain Frisch
2002-10-22 21:10                   ` Dmitry Bely
2002-10-23  7:15                 ` Alessandro Baretta
     [not found]         ` <Pine.LNX.4.44.0210221008100.6093-100000@grace.speakeasy.ne t>
2002-10-22 17:44           ` Chris Hecker [this message]
2002-10-22 19:31         ` Sven Luther
2002-10-22 23:38           ` Chris Hecker
2002-10-23  4:16             ` David Brown
2002-10-23 10:01           ` Diego Olivier Fernandez Pons
2002-10-23 10:36             ` Sven Luther
2002-10-23 11:41               ` Alessandro Baretta

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=4.3.2.7.2.20021022103356.0361f910@mail.d6.com \
    --to=checker@d6.com \
    --cc=brogoff@speakeasy.net \
    --cc=caml-list@inria.fr \
    --cc=xavier.leroy@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).