Browse thread
[Caml-list] Executable size?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Sven Luther <sven.luther@w...> |
| Subject: | Re: [Caml-list] Executable size? |
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