From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=5.0 tests=DNS_FROM_SECURITYSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 650BFBBAF for ; Wed, 19 Nov 2008 08:33:46 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar4AAMBPI0nUnw6SkGdsb2JhbACCPJEbAQEBAQkJDAcRBL1Wgnk X-IronPort-AV: E=Sophos;i="4.33,630,1220220000"; d="scan'208";a="31589436" Received: from ptb-relay02.plus.net ([212.159.14.146]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 19 Nov 2008 08:33:46 +0100 Received: from [87.115.4.231] (helo=leper.local) by ptb-relay02.plus.net with esmtp (Exim) id 1L2hZI-0001SR-W6 for caml-list@yquem.inria.fr; Wed, 19 Nov 2008 07:33:45 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Wanted: your feedback on the hierarchy of OCaml Batteries Included Date: Wed, 19 Nov 2008 08:36:14 +0000 User-Agent: KMail/1.9.9 References: <1227002178.6170.25.camel@Blefuscu> <200811182330.03947.jon@ffconsultancy.com> <1227076192.6290.7.camel@Blefuscu> In-Reply-To: <1227076192.6290.7.camel@Blefuscu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811190836.15015.jon@ffconsultancy.com> X-Plusnet-Relay: 8b8c422909a1b40ba8052cd16bba1306 X-Spam: no; 0.00; ocaml:01 ocaml:01 printf:01 printf:01 flattening:01 striking:98 frog:98 wrote:01 wrote:01 caml-list:01 data:02 modules:02 modules:02 hierarchies:03 module:03 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. Sure. > 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" etc. > 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. http://www.ffconsultancy.com/?e