Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 (15:44)
From: Eric Dahlman <edahlman@a...>
Subject: Re: [Caml-list] Executable size?
John J Lee wrote:

> I don't understand what this has to do with what I said in the quote.
> Yes, C runtime is present on essentially all systems, but the point is
> that C and O'Caml are fundamentally different: with C, you can *ignore*
> that runtime, and write a program that simply doesn't use it at all.  Not
> so with O'Caml (for perfectly good and sensible reasons).

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.

The runtime for any language implements the irreducible primitives of 
that language implementation and is usually quite small.  In the case of 
  C this includes implementations of primitive data types and operators 
not natively supported on a given architecture as well as support for 
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.

Now we have been talking much larger numbers in this thread and that is 
because people have been using some imprecise definitions for runtime. 
These bigger numbers have been including the notion of a standard 
library into the runtime.  In that case C looks smaller because its 
"standard runtime library" is already present on the system awhile 
OCaml's is not.

>>One way to even things up is require the C version to link to all of its
> [...]
> Also, I'm simply looking for a way to distribute code, not trying to start
> a pissing contest between C and O'Caml :-) so I'm not interested in
> "evening things up".

Nor am I (but I bet my language can hit that fly up on the wall...)  The 
   problem is that the measures being discussed were incorrect and 
misleading, I was trying to point out that fact.  When honestly looking 
at things from the standpoint of the runtime C is the smallest OCaml a 
close second and C++ is huge (libsupc++.a is 162k, which I think is the 
one we want).

This is an exact parallel to the old argument that Common Lisp runtime 
is HUGE while Scheme is small.  When you separate out the runtime from 
the library they are really about the same but that does not make for 
good flame wars.

Language implementation and runtime size is really an interesting topic 
but it is not a practical metric for measuring a language.  Furthermore, 
going back to the beginning of this thread it actually doesn't relate to 
your original problems with download size - those are really problems of 
politics, economics and a little engineering.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: