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
recursively?)
It would also be possible to do it (approximately) without touching
the compiler, say using ocamldep, but it would get messy.