From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_SECURITYSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 113D7BBAF for ; Tue, 18 Nov 2008 13:50:58 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgCAEJJIknAXQIngWdsb2JhbACTWQEBFiK+KYJ5 X-IronPort-AV: E=Sophos;i="4.33,625,1220220000"; d="scan'208";a="31561144" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Nov 2008 13:50:57 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id mAICou85004307 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 18 Nov 2008 13:50:57 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoUBAEJJIknUGypBkWdsb2JhbACTWQEBAQEJCwoHEQO+JoJ5 X-IronPort-AV: E=Sophos;i="4.33,625,1220220000"; d="scan'208";a="20079858" Received: from smtp8-g19.free.fr ([212.27.42.65]) by mail1-smtp-roc.national.inria.fr with ESMTP; 18 Nov 2008 13:50:56 +0100 Received: from smtp8-g19.free.fr (localhost [127.0.0.1]) by smtp8-g19.free.fr (Postfix) with ESMTP id 5FB5B32A79C; Tue, 18 Nov 2008 13:50:56 +0100 (CET) Received: from [192.168.17.1] (ivr94-8-88-162-26-239.fbx.proxad.net [88.162.26.239]) by smtp8-g19.free.fr (Postfix) with ESMTP id A22DD32A7F9; Tue, 18 Nov 2008 13:50:55 +0100 (CET) Message-ID: <4922BA75.7070303@users.sourceforge.net> Date: Tue, 18 Nov 2008 13:52:05 +0100 From: Zheng Li User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: David Teller Cc: OCaml , Richard Jones Subject: Re: Wanted: your feedback on the hierarchy of OCaml Batteries Included References: <1227002178.6170.25.camel@Blefuscu> <20081118100625.GA25627@annexia.org> <49229725.5090704@users.sourceforge.net> <1227007338.6170.39.camel@Blefuscu> In-Reply-To: <1227007338.6170.39.camel@Blefuscu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4922BA31.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 iter:01 ocamlfind:01 ocamlc:01 0100,:01 sourceforge:01 wrote:01 wrote:01 compile:01 executables:01 data:02 modules:02 modules:02 referenced:02 underscore:02 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? >