[ocaml-platform] on the need and design of OCaml namespaces

Alain Frisch alain.frisch at lexifi.com
Wed Feb 27 09:40:31 GMT 2013


After reading again some messages in this thread, I've the feeling that 
people are looking for a better notion of "library", and not strictly 
about ways to manage (module) names.

Currently, a library is made of many different things:

  - Some public interfaces (.cmi files), which need to be located 
somewhere on the file system, often on a library-specific sub-directory.

  - Some compiler flags to add to make them accessible (-I).

  - Some other compiler flags to be added when the library is to be used 
(-pp / -ppx).

  - Some implementation (.cmxa/.a) to be passed to the linker.  Even 
"private" modules in those implementations are not allowed to clash with 
other private modules in other libraries.


The complexity of all that makes the use of ocamlfind more or less 
mandatory.

It seems to me that when people say they want to "open a namespace", 
they really mean "use a library", and they want to be able to specify 
that in the source code, and maybe even for a local scope within a unit. 
  Moreover, they want to extend the notion of "using a library" to even 
more things, like bringing some values in the global scope.

At least this is now my interpretation of some requests specified by 
Yaron, for instance.  Maybe this is only a matter of terminology, but 
I've to say that I can more easily relate to a desire to improve support 
for "libraries", than to the one to introduce namespaces.


Alain


More information about the Platform mailing list