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
Re: [Caml-list] OCaml standard library improvement
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: Re: [Caml-list] OCaml standard library improvement
Nicolas George wrote:

> A string
> library should be one module, we agree. Let's say it is "String". Then
> as soon as you use one function of the String module, the resulting
> binary will hold _all_ the code in the String module. If you have a lot
> of functions in the module (and this is what we want), you have a huge
> binary. Berk.
> As far as I know, there is no hack to avoid it. It would be necessary to
> rethink the format of the .cmo or .cma files to allow that.

Two viewpoints:

(1) in the "old" days, one could extract only
needed functions from libraries: this kept executables small.

(2) in the modern system, the whole library is shared
and linked dynamically, so the executable doesn't include
the code at all. The actual overhead depends on how many
processes share the code.

So there are two ways forward:

(1) split libraries into
segments to ensure minimal static linkage

(2) make ocaml emit code which can be linked
into a shared library

Whilst these tasks are not mutually exclusive,

I'd see (1) as a nice optimisation, whilst (2) is
a pre-requisite for industrial acceptance.

John Max Skaller,
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.

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