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

Maxence Guesdon Maxence.Guesdon at inria.fr
Fri Feb 22 13:13:50 GMT 2013


On Fri, 22 Feb 2013 13:42:21 +0100
Daniel Bünzli <daniel.buenzli at erratique.ch> wrote:

> Le vendredi, 22 février 2013 à 12:38, Wojciech Meyer a écrit :
> > The reason why I think we should use hierarchy is:
> > - ability to structure several libraries into same "shelves" - looking
> > what Haskell does [1]: Control.Arrow or Data.Array. It will help to
> > provide one and consistent library for the platform. It does not
> > necessarily require (but enables) to use "provenance" style of naming
> > (e.g. Java convention)
> 
> Actually I find this way of structuring things not pertinent *at all*. It brings absolutely nothing.
> 
> First with hierarchies there's always the problem that at certain point you want two things to be in two different places. This is why "tags" are usually better than "folders" to organize things, see e.g. gmail.  
> 
> Second if we take the link you provided there are not so much toplevel descriptors which means that it lengthen the names without bringing much benefit except noise. More precisely, for me there are two things that needs to be distinguished:
> 
> 1) A user looking for a library to solve a problem.
> 2) A user writing code with the library he found or reading code already written.
> 
> In case 1) a tagging system is a better way of finding what he's looking for and this doesn't actually happen in the language anyway. More likely he'll browse opam's html representation (opam recently added tags I'm sure they will eventually implement tag browsing in their html representation)
> 
> In case 2) the reader gets absolutely no benefit of these intermediate descriptors/hierarchies (e.g. unsurpisingly Data.Time.Calendar isn't just "Data"). He just need a quick way to access the leaves of the hierarchy. So the hierarchy itself is here again useless in the language, it's only noise.  
> 
> Keep it flat.

I fully agree.

All this reminds me of the hierarchy discussions on the batteries list:
  https://lists.forge.ocamlcore.org/pipermail/batteries-devel/2008-November/thread.html#278
The hierarchy looked like this:
  http://batteries.forge.ocamlcore.org/doc.preview:batteries-alpha2/batteries/html/api/index.html

"The flatter, the better".

Cheers,

Maxence, 


More information about the Platform mailing list