English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Executable size?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-13 (19:58)
From: John J Lee <jjl@p...>
Subject: Re: [Caml-list] Executable size?
On Thu, 13 Nov 2003, Eric Dahlman wrote:
> My point was that if you are making these sorts of comparisons you
> cannot just *ignore* the runtime in the C/C++ case and more importantly
> that C and O'Caml are not fundamentally different in this regard.  By
> definition it is impossible to write a program in C or C++ which does
> not use the respective runtime, it cannot be ignored.

Hmm, you're right.

I had confused myself, I guess, by absorbing the widespread use of "C
runtime" to mean MSVCRT.DLL (or libc.so, or whatever).

> the setting up the initial environment.  In the case of gcc this is
> captured in three files which a linked with each C program.  They are
> crtbegin.o 1.6k
> crtend.o   1.2k
> libgcc.a  46.3k
> So it would be reasonable to say that the C runtime is 49k.
> Now in the case of O'Caml I don't know what the exact numbers are but
> the ZINC interpreter is on the order of 75k and that includes the ocaml
> runtime. So they are really similar, really the only big difference in
> runtime requirements for OCaml is the garbage collector.

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

Hope I'm not going round in circles here...


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