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 TAA01953; Wed, 12 Nov 2003 19:39:43 +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 TAA02256 for ; Wed, 12 Nov 2003 19:39:41 +0100 (MET) Received: from mwinf0503.wanadoo.fr (smtp5.wanadoo.fr [193.252.22.26]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hACIde102661 for ; Wed, 12 Nov 2003 19:39:40 +0100 (MET) Received: from iliana (AStrasbourg-206-1-23-207.w81-49.abo.wanadoo.fr [81.49.251.207]) by mwinf0503.wanadoo.fr (SMTP Server) with ESMTP id 56E6D6800252; Wed, 12 Nov 2003 19:39:40 +0100 (CET) Received: from luther by iliana with local (Exim 3.36 #1 (Debian)) id 1AJztY-0004Jl-00; Wed, 12 Nov 2003 19:39:12 +0100 Date: Wed, 12 Nov 2003 19:38:59 +0100 To: Brian Hurt Cc: Richard Jones , John J Lee , caml-list@inria.fr Subject: Re: [Caml-list] Executable size? Message-ID: <20031112183858.GB16395@iliana> References: <20031112173335.GA32347@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i From: Sven Luther X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sven:01 luther:01 sven:01 luther:01 0600,:01 haskell:01 runtime:01 criticism:01 runtime:01 statically:01 dynamically:01 simplistic:01 dynamically:01 statically:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Nov 12, 2003 at 01:06:08PM -0600, Brian Hurt wrote: > 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 Mmm (on i386 and with 3.07+2) : $ cat hello.ml Printf.printf "Hello World!\n" $ ocamlc hello.ml -o hello.byte $ ls -l hello.byte 36025 hello.byte $ ocamlc hello.ml -custom -o hello.custom $ ls -l hello.custom 181718 hello.custom $ ocamlopt hello.ml -o hello.native $ ls -l hello.native 149877 hello.native That said : $ cat hello #!/usr/bin/ocamlrun /usr/bin/ocaml Printf.printf "Hello World!\n";; $ ls -l hello 68 hello Friendly, Sven Luther ------------------- 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