[ocaml-platform] Unique file names

Alain Frisch alain.frisch at lexifi.com
Tue Mar 5 10:10:39 GMT 2013


On 03/05/2013 03:48 AM, Yaron Minsky wrote:
> Could all of these benefits be obtained by having longer names for
> files generated as part of the compilation (.cmx, .cmo, .cmi, etc.),
> but keep the source file names short?  i.e., one could imagine that if
> you put "-put-in-namespace core" on the command-line to ocamlc, it
> would generate "core_list.ml" when given the file "list.ml".  The onus
> would be on the build system to provide said flags, but it would seem
> to simplify things thereupon.

This would simplify the life of the library developer a little bit, but 
it would not really give the same benefits:

  - If you get an error message (or an output from a tool, such as 
Bisect or a dead code detector) with a long name, it's more difficult to 
find the corresponding source file (e.g. to look the .mli file).

  - You need to adapt all tools (ocamldep, ocamldoc and also third party 
tools), and this might change their interface (e.g. for ocamldoc, you 
will need to specify for each source file what's its implicit prefix).

  - Generic rules (e.g. in Makefiles) are more difficult to write.

  - You can deploy compiled files for several libraries in the same 
directory, but not the corresponding .mli files (for documentation purpose).


-- Alain


More information about the Platform mailing list