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
ocaml: demand-driven compilation?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-09-15 (06:40)
From: William Chesters <williamc@d...>
Subject: ocaml: demand-driven compilation?
Are there plans to extend the separate compilation system of ocaml to
take over some of the functions of make, as the Java compiler does?
The Java compiler not only checks sources against the precompiled
signatures of the modules it refers to, as ocamlc/ocamlopt do; it also
checks the existence and modtime of the bytecode file against the
source and (re)compiles if necessary.  With a little hack to get any
necessary standard libraries included in the link command
automagically, we wouldn't need makefiles at all.  For me it would
even be nice to able to specify the C files implementing the external
functions needed by each source _in the source itself_.

I think it would be quite easy to hack something together to do this,
since [Env.find_pers_struct] very nearly constitutes the necessary
hook.  (Mind you it would be even easier if the compiler was free of
naughty global variables---I don't think it's safe to invoke it

It would also be possible to do it (approximately) without touching
the compiler, say using ocamldep, but it would get messy.