[ocaml-platform] An alternative proposal for namespaces
Alain Frisch
alain.frisch at lexifi.com
Wed Mar 20 18:41:31 GMT 2013
On 03/20/2013 03:21 PM, Gabriel Scherer wrote:
> - tool distribution: Leo suggested something along the names of
> "ocamlns <namespace information> -resolve Foo..Bar". That's indeed an
> obvious idea that would solve the issue of non-OCaml tools quite
> easily.
This does not really work with "simple namespaces", because "ocamlns"
can only know which files currently exist, not which files can be built.
You will need to re-implement the resolution logic in omake, maybe
calling an helper tool to parse individual .mlpath files.
> (I'm not too convinced by the efficiency argument ("calling an
> external program ..."): mapping files are also not a terribly
> efficient way to provide information for lookups. In the OCaml-land, a
> marshalled hashtable or Map could be fairly more efficient for
> example.)
I'm pretty sure that the difference between parsing a simple text file
and loading/unmarshaling a binary hashtable is negligible compared to
spawning a new process, at least under Windows. And we are talking
about doing it once for each file for which dependencies need to be
computed *and* for each .mlpath file. There will be a huge slowdown if
the resolution algorithm suggested by Leo had to be implemented in
omake. Note that "ocamldep" would also itself be a little bit slower
since it would have to access many directories (or do many
Sys.file_exists) in addition to reading .mlpath files, instead of just
reading .mlpath files.
Alain
More information about the Platform
mailing list