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

Yaron Minsky yminsky at janestreet.com
Tue Feb 26 14:16:09 GMT 2013


On Tue, Feb 26, 2013 at 7:56 AM, Leo White <lpw25 at cam.ac.uk> wrote:
>> I lament that, expect Alain, nobody gives a damn about letting users
>> redefine their own names or paths in a different way that what the module
>> provider planned for.
>
>
> I wouldn't say that people don't give a damn about it, only that it is not a
> priority: first we need to be able to give a component the name its
> developer intended for it, then we can worry about how to allow other people
> to rename it.
>
> I also think that it is important that the default case (i.e. use the name
> that the developer gave it) requires no input on the part of the user.

I agree.  I would like to let users flexibly redefine namespaces, and
to have multiple namespaces for the same modules.  One example of the
use of this that I'd have in Core is Core.Std and Core.Stable.

Core.Std is the standard thing you open if you want to use Core in the
ordinary way.  Nothing to see here.

Core.Stable exports just a subset of Core, in particular, a set of
so-called "stable" types that are guaranteed not to change from
release to release.  (there are explicit version numbers attached to
these to allow new versions to be minted without changing the old.)
This is useful for building protocols that OCaml programs can
communicate with even when they're built with different versions of
Core.

It would be ideal if the namespace proposal supported this use case,
and once it does, well, it seems like you almost need to have the
flexibility you describe.


More information about the Platform mailing list