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

Daniel Bünzli daniel.buenzli at erratique.ch
Wed Feb 27 08:49:01 GMT 2013


Le mercredi, 27 février 2013 à 07:58, Gabriel Scherer a écrit :
> I don't like your lazy initialization scheme because it changes the
> observable semantics of the the OCaml language when modules have
> global side-effects. Currently, the effects are evaluated in the
> linking order of the modules, not the use order.

You are right that it may not be sensible to change that now. On the other hand IIRC my delves into module research a few years ago, in fact the strict initialization semantics combined with the structural (vs nominal) aspect is the source of many headaches, notably the recursive module issue.

While Leo convinced me that "solving pack" won't help us given the current runtime module semantics. I'm rather dubious about the namespace solution since for me (1) If we follow what Yaron wants (and that in someway I also do want) a namespace eventually looks diabolically like a module, at least when you open it (2) It doesn't seem to solve the problem for the small library I mentioned (can now be peek at here [1]) or at least it doesn't allow to me to write it the simple way I'd like to write it.

At that point, I would personally, rather wait for the longer term solutions Didier mentions backed by solid type system research (if that actually solves these problems, I'm no longer up-to-date with these things, e g. Rossberg's 2013 paper) rather than integrate solutions that seem to be guided by ad-hoc considerations. But I guess that's not an option for the platform.  

Daniel

[1] https://github.com/dbuenzli/gg




More information about the Platform mailing list