Version française
Home     About     Download     Resources     Contact us    
Browse thread
Wanted: your feedback on the hierarchy of OCaml Batteries Included
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Zheng Li <zheng_li@u...>
Subject: Re: Wanted: your feedback on the hierarchy of OCaml Batteries Included
David Teller wrote:
> I thought the linker only linked in symbols which were actually used?

You really should check.

I have not yet looked too much into the source, but if the 
batteries_core.ml is one of them to be referenced anyway, I'm afraid all 
modules (not just parents/siblings) will be linked.

Try to compile the following source into executable:

----
open Batteries.Data.Persistent.List

let _ = iter
----

You will end up with being asked for numerous unrelated modules during 
the linking phrase, or you can use the recommended "ocamlfind 
batteries/ocamlc" shortcut. Either way, an executable of +50 times 
bigger in size (i.e. +1M for the 2 lines) than using the standard List 
will be produced.

--
Zheng

> On Tue, 2008-11-18 at 11:21 +0100, Zheng Li wrote:
>>> Your biggest problem is using dot ('.') instead of underscore ('_').
>>> Using a dot means that the System namespace cannot be extended by
>>> external packages.  If you use an underscore then an external package
>>> can extend the namespace (eg. by providing System_Newpackage)
>> And, doesn't that forces all sub modules to be linked into the final 
>> executables even if we only use one of them?
>