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 TAA02715; Wed, 12 Nov 2003 19:47:00 +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 TAA02724 for ; Wed, 12 Nov 2003 19:46:58 +0100 (MET) Received: from cmailg4.svr.pol.co.uk (cmailg4.svr.pol.co.uk [195.92.195.174]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hACIkv103300 for ; Wed, 12 Nov 2003 19:46:58 +0100 (MET) Received: from modem-525.beedrill.dialup.pol.co.uk ([217.135.34.13]) by cmailg4.svr.pol.co.uk with esmtp (Exim 4.14) id 1AK013-0000cH-0Z for caml-list@inria.fr; Wed, 12 Nov 2003 18:46:57 +0000 Date: Wed, 12 Nov 2003 18:46:36 +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: Message-ID: References: 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 criticism:01 runtime:01 statically:01 simplistic:01 dynamically:01 statically:01 runtime:01 reuse:01 reuse:01 linked:01 linked:01 ocaml:01 ocaml:01 garbage:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 12 Nov 2003, Brian Hurt wrote: > On Wed, 12 Nov 2003, Richard Jones wrote: [...] > > This is not a criticism of OCaml, but the executables do tend to be > > quite large. This seems mainly down to the fact that OCaml links the > > runtime library in statically. There was previous discussion on this [...] > This isn't as bad as it sounds. A simplistic "hello world!" application > in Ocaml weighs in at 112K, versus 11K for the equivelent (dynamically > linked) C program- almost entirely either statically linked standard > libraries and infrastructure (garbage collections, etc.)- stuff that > doesn't expand with larger programs. OK. Is that 100K difference for "hello world" (which doesn't necessarily stay the same for larger programs, as you say below) simply a result of the fact that C has the "unfair" advantage of already having its runtime sitting on everyone's hard drive already? > A naive assumption would be that an Ocaml program is about 100K or so > larger than the equivelent C program. Not much, considering how easy it > is to get executables multiple megabytes in size. [...] > Ocaml gets a lot more code reuse, and thus can actually lead to smaller > executables. I don't understand what you mean by that (probably my fault). What do you mean by "code reuse" here? I usually understand that phrase to mean using code written by people other than me, but you seem to mean it in a different sense. > Unless you have special constraints, the difference between C program > sizes and Ocaml program sizes are not enough to be worth worrying about. I don't really agree that the problem of distributing simple (few lines of code) applications in small executables is all that "special". Certainly there are *many* applications where you don't need that; equally, there are quite a few where you do need/want that. 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