From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA31511; Tue, 22 Oct 2002 19:44:11 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA31538 for ; Tue, 22 Oct 2002 19:44:10 +0200 (MET DST) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id g9MHi9D14108 for ; Tue, 22 Oct 2002 19:44:09 +0200 (MET DST) Received: (qmail 97581 invoked from network); 22 Oct 2002 17:44:07 -0000 Received: from adsl-host-sf-228.apexworld.net (HELO checkerlap.d6.com) (66.114.212.228) by relay1.pair.com with SMTP; 22 Oct 2002 17:44:07 -0000 X-pair-Authenticated: 66.114.212.228 Message-Id: <4.3.2.7.2.20021022103356.0361f910@mail.d6.com> X-Sender: checker@mail.d6.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Tue, 22 Oct 2002 10:44:34 -0700 To: brogoff@speakeasy.net, "caml-list@inria.fr" From: Chris Hecker Subject: Re: [Caml-list] Error during partial linking Cc: Xavier Leroy In-Reply-To: References: <20021022190056.A28301@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >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