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 QAA15690; Sat, 15 Nov 2003 16:13:30 +0100 (MET) 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 QAA27260 for ; Sat, 15 Nov 2003 16:13:28 +0100 (MET) Received: from cmailg3.svr.pol.co.uk (cmailg3.svr.pol.co.uk [195.92.195.173]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAFFDS118909 for ; Sat, 15 Nov 2003 16:13:28 +0100 (MET) Received: from modem-681.alakazam.dialup.pol.co.uk ([217.135.13.169]) by cmailg3.svr.pol.co.uk with esmtp (Exim 4.14) id 1AL275-0008AN-53 for caml-list@inria.fr; Sat, 15 Nov 2003 15:13:27 +0000 Date: Sat, 15 Nov 2003 15:13:24 +0000 (GMT) From: John J Lee X-X-Sender: john@alice To: caml-list@inria.fr Subject: Re: [Caml-list] Executable size? In-Reply-To: <1068903697.25869.101.camel@pelican> Message-ID: References: <3FB2B050.8050901@atcorp.com> <3FB3A6A6.8010108@atcorp.com> <1068903697.25869.101.camel@pelican> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 statically:01 runtime:01 o'caml's:01 c's:01 stub:01 dynamically:01 implying:01 c's:01 printf:01 statically:01 relocatable:01 dynamically:01 implemented:01 ocamlrun:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, 16 Nov 2003, skaller wrote: > On Fri, 2003-11-14 at 06:58, John J Lee wrote: [...] > > OK. Getting back to the original question again (how to reduce data to be > > transferred over the network), both O'Caml and C statically link this > > runtime stuff, right? So, why is O'Caml's "hello world" (compressed) 45k, > > to C's 1 or 2k? Is that 43k the garbage collector? Or is it mostly that > > O'Caml, in contrast to C, is linking in a bunch of stuff from its standard > > library that isn't strictly required for "hello world"? Or something else > > again?? > > > > Hope I'm not going round in circles here... > > The Ocaml equivalent of a C stub program which dynamically > links to the C run time is bytecode. And, you're implying, even C's "hello world" *is* using the C standard library, because of printf -- and O'Caml is using it's standard library for the same reason. So part of the O'Caml standard library is statically linked into hello world, thus explaining part of the 43k difference? In that case, I wonder what the C / O'Caml executable size discrepancy for "hello world" becomes if you use only OS routines directly? > Ocaml native code compiler, at least on the x86, > does not generate relocatable code, and so Ocaml > library functions cannot be dynamically linked. > [At present .. :] So, an O'Caml .DLL or .so is implemented using O'Caml bytecode? > In my opinion, you best bet is to generate bytecode > and distribute that. Your clients WILL have to download > the bigger ocamlrun driver harness, but hopefully > only once. That's not useful in the case where the user is only downloading one program, unfortunately. John ------------------- 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