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] Single-case union types as strong typedefs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-10-26 (20:07)
From: Jon Harrop <jon@j...>
Subject: Re: [Caml-list] Combined compilation and linking
On Tuesday 26 October 2004 18:34, skaller wrote:
> Why do we need separate compilation
> and linkage in the style of C on modern systems?

In other languages you might want to do separate compilation in order to 
distribute object files instead of source. Seeing as this doesn't really work 
in OCaml, I can't see that another approach couldn't be equally productive.

> Surely, we would like to have fast compilations, but
> why can't the compiler treat that as an automatic
> optimisation, rather than a user managed one?

As a start, this could be performed by a combined compiler-linker which could, 
for example, cache compilations by file name (module name) and the hash and 
contents of the file for the "n" most recently compiled files. Then you just 
feed this program all your source files.

More advanced versions could split source files up and compile each part 
separately, combining the result.

A preliminary test of the potential productivity of this would be to measure 
the time taken to load vs the time taken to compile some example source