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-12 (18:05)
From: Dustin Sallings <dustin@s...>
Subject: Re: [Caml-list] Executable size?

On Nov 12, 2003, at 8:14, 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)?

	Well, the bin is bigger than a minimal C app with the same 
functionality.  There is no runtime library required (I build and 
distribute apps).  I somehow don't have ghc on my machines here to do a 

> Are there any easily-identifiable, non-obvious, factors that affect
> executable size (I'm talking about end-use factors, rather those 
> resulting
> from the design decisions taken by the language designers and
> implementors)?

	(don't know)

> I currently use Python by preference, but I'm interested in a language
> (other than C/C++!) that doesn't depend on a big runtime library and
> generates "reasonably" small executables -- modems are here to stay 
> for a
> while yet.

	The stuff I build on my Mac ends up being about 300k so far.  That 
seems reasonably small to me.

	I'm not sure what a modem has to do with your distribution, but there 
are options.  You could distribute the source to your app (which will 
be way smaller than the equivalent C or C++ application) and compile 
elsewhere, or you can use the transfer time to bask in your 
productivity and performance gains.  :)

	Python is a bad reference for two reasons:

	1) You don't typically distribute compiled python apps (and when you 
do, it's always bytecode).
	2) Ocaml's runtime is *amazingly* fast.

	I've prototyped a few apps in python before rewriting in ocaml for 
performance.  The speed gains alone are beginning to push python away 
from being my primary utility app language.  I like a lot about the 
language as well.

Dustin Sallings

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