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 TAA00308; Wed, 12 Nov 2003 19:07:23 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA00312 for ; Wed, 12 Nov 2003 19:07:21 +0100 (MET) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hACI7I128646 for ; Wed, 12 Nov 2003 19:07:18 +0100 (MET) Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id hACI72C27540; Wed, 12 Nov 2003 12:07:03 -0600 (CST) Date: Wed, 12 Nov 2003 13:06:08 -0600 (CST) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Richard Jones cc: John J Lee , Subject: Re: [Caml-list] Executable size? In-Reply-To: <20031112173335.GA32347@redhat.com> Message-ID: 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 haskell:01 runtime:01 criticism:01 runtime:01 statically:01 dynamically:01 simplistic:01 dynamically:01 statically:01 reuse:01 linked:01 linked:01 ocaml:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 12 Nov 2003, Richard Jones wrote: > On Wed, Nov 12, 2003 at 04:14:54PM +0000, John J Lee wrote: > > How does O'Caml compare with languages like Haskell (ghc), C and C++ for > > executable size? Does compiled code depend on a runtime library (and how > > big is that, if so)? > > 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 > list about the merits and problems with linking the runtime > dynamically. 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. 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. But in my experience (depending upon the program), Ocaml gets a lot more code reuse, and thus can actually lead to smaller executables. Unless you have special constraints, the difference between C program sizes and Ocaml program sizes are not enough to be worth worrying about. -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian ------------------- 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