English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Wanted: your feedback on the hierarchy of OCaml Batteries Included
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-11-19 (07:33)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Wanted: your feedback on the hierarchy of OCaml Batteries Included
On Wednesday 19 November 2008 06:29:52 David Teller wrote:
> On Tue, 2008-11-18 at 23:30 +0000, Jon Harrop wrote:
> > I only have one major concern: you say "with the large number of modules
> > involved, we would need a hierarchy of modules" but the number of modules
> > involved is tiny (a few dozen in OCaml compared to tens or even hundreds
> > of thousands in any industrial-strength language) because OCaml has very
> > few libraries. Yet your module hierarchies are already enormous and often
> > require a longer sequence of modules to reach simple functionality than
> > is required in a comparatively-huge library like .NET.
> Well, we're trying to be future-proof.


> Don't you think we should? 

No. :-)

I think it is extremely unlikely that OCaml will get many more libraries so I 
do not think it is worth spending much time designing infrastructure to cope 
with that eventuality.

> > To me, the most striking example is printf which is just printf in F#,
> > Printf.printf in OCaml and is now Text.Printf.printf in OCaml+Batteries.
> > Surely this is a step in the wrong direction?
> Well, if you it's just the matter of [printf], we can add it to
> [Batteries.Standard] to import it in the standard namespace. The biggest
> question is how many things we want imported in that standard namespace.
> Or you could start your files with [open Text.Printf] or [module P =
> Text.Printf] or any similar combination.

You could but it will still deter newbies:

  open Text.Printf
  printf "Hello world!\n"


> Oh, and, [Printf.printf] works, too. This is one of the modules which
> have a shortcut to their path in the hierarchy, to mirror the base
> library.

Sure. I would certainly vote for flattening out the hierarchy as much as 
possible though. For example, I would keep containers in List, Array etc. and 
not nest them in Data or Containers or Collections.

Dr Jon Harrop, Flying Frog Consultancy Ltd.