<div dir="ltr"><div><div>I concur with Yaron on his first point, but I disagree with his second point.<br><br></div>In support of the idea that Core.Std or Async.Std might include some modules to automatically open, consider that the default namespace currently provided in OCaml automatically opens the module Pervasives... to the OCaml developers, this auto-open feature was clearly valuable. Surely, third-party libraries may have their own notion of "pervasives", right? Moreover, as Yaron states, packed modules already support this idiom... it would be an awful shame if some OCaml users ignored the new namespace features in favor of packed modules, willing to deal with their shortcomings to gain their advantages, when these advantages could also be added to namespaces.<br>
<br></div>As to the second point: personally, I believe it is more important for the OCaml community to provide free specification of namespaces within a file (possibly constructed by the user and not the library author). Part of the utility of namespaces that I see is the ability to use the author's modules in a way beyond what he originally intended for his purpose. As you said, your requirements are easy to control within Jane Street... I don't think it's important to export these requirements outside Jane Street, unless other OCaml users have similar needs. I would rather that my build system do exactly as I specify, rather than try to enforce some namespace-based security guarantees (in a way that likely would not stand up to malicious circumvention).<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 11, 2013 at 6:51 PM, Yaron Minsky <span dir="ltr"><<a href="mailto:yminsky@gmail.com" target="_blank">yminsky@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Some thoughts spurred by reading Leo's proposal:<br>
<br>
- AUTO-OPENS ARE NOT JUST FOR CORE. Leo proposes not having<br>
auto-opened modules associated with namespaces, and instead allowing<br>
opens to be set at the commandline. This would not solve our<br>
problem, and we would not use them if they were available.<br>
<br>
It's important to understand Core.Std is not the only example.<br>
Another example among our publically released libraries is<br>
Async. All Async programs should open Async.Std, which adds a number<br>
of important values to the namespace, not just modules. Indeed,<br>
there are many different application frameworks we have where there<br>
are a default set of libraries that should be opened as part of<br>
opening the namespace.<br>
<br>
This is a common and highly useful idiom, and one that is well<br>
supported by -pack, and I think it should be supported by namespaces<br>
as well. Providing module opens as part of namespaces is both<br>
natural from the user perspective (both module opens and and module<br>
aliases are namespace manipulations, and thus naturally go<br>
together), and important from a usability perspective.<br>
<br>
- TRUSTING NAMESPACES. When thinking about whether files should be<br>
able to declare their namespaces, one thing that's worth considering<br>
is the notion of trust. The Core library is a particularly closely<br>
code-reviewed and tested collection of code, and one can feel pretty<br>
safe that if you use anything inside of Core.Std, you're using a<br>
pretty trustworthy piece of code.<br>
<br>
On the other hand, Core_extended.Std is less closely reviewed, and<br>
I would want to avoid it for many trusted applications. Within Jane<br>
Street, this is easy for us to manage: we have clear control at the<br>
build-system level of what goes into Core.Std, and we can enforce<br>
standards of testing and code review on it.<br>
<br>
If one allows completely free specification of namespaces from<br>
within a file, this could undermine that sense of trust. I'd like<br>
to make sure that we don't undermine the ability to enforce in the<br>
build system that all files for a given namespace come, say, from a<br>
certain directory.<br>
_______________________________________________<br>
Platform mailing list<br>
<a href="mailto:Platform@lists.ocaml.org">Platform@lists.ocaml.org</a><br>
<a href="http://lists.ocaml.org/listinfo/platform" target="_blank">http://lists.ocaml.org/listinfo/platform</a><br>
</blockquote></div><br></div>