caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michael Furr <furr@cs.umd.edu>
To: caml-list List <caml-list@inria.fr>
Subject: Re: Cherry-picking modules (was Re: [Caml-list] [ANN] OCaml Reins 0.1 - Persistent Data Structure Library)
Date: Wed, 26 Sep 2007 11:32:49 -0400 (EDT)	[thread overview]
Message-ID: <Pine.GSO.4.64.0709261109010.10669@loompa> (raw)
In-Reply-To: <55A4E82E-3D05-4F79-A8A6-A87905EB4FC8@epfl.ch>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3914 bytes --]



On Wed, 26 Sep 2007, Daniel Bünzli wrote:

> There are a lot of useful reusable modules in many projects like extlib, 
> ocamlnae, etc, however they are all tied to their "cathedral" [1] even though 
> these ties are sometimes very small and could be functorized away (or dropped 
> altogheter). Now if I _just_ want to use the Unzip module of extlib, the 
> Cf_tai64 module of ocamlnae and your Patricia set.  Why do I have to install 
> these three whole libraries whereas I could simply integrate these three 
> modules in my project ?

Why should you not?  There is no good reason to not use the entire library 
instead of just pulling out a single funciton.

I think you need to separate who are *developers* and who are *users*. 
Users are those which you should not depend on having an OCaml development 
environment intalled.  This could be users of a stand-alone app, or 
perhaps coders using felix.  When you distribute your software to them, it 
will be in binary form, and you should take care to ensure this is as easy 
as possible (especially if you're on a platform like windows).  However, 
this does not require you to keep them in your own source tree.

For *developers*, you should have every expectation that they can install 
a sufficient environment themselves.  No OCaml build system is that bad 
(especially compared to other languages) and I expect *every* user of my 
library to be able to build its dependences (or, more realistically, 
install a package manager to build the deps for them).

> I think developers of reusable components should try to strive for 
> *focused*, independent modules, even if it means functorization and 
> convention. Eventually it makes it easier for developers to integrate 
> these modules and exchange specific parts if some module poses a problem 
> or better alternatives popup.

But you should start by raising the bar for re-use, not lowering it.  Use 
the libraries like you *should* be able to do.  If developers find this 
too difficult to use, tools will follow.  Rely on the bazaar.

> Again I'm not for embedding everything in projects, sometimes it is 
> unrealistic. But for exemple I'd systematically do this for data structures, 
> unless of course they are in the standard distribution.

There is a significant advantage to combining various data structures into 
a single package.  For one, there is a lot of room for code sharing.  A 
lot of the functionality of data structures can be implemented in terms of 
a few small functions.  (For instance, to_string is easily implemented 
with fold).  Using mixin modules to extend these to complete 
implemetations saves a lot of redundant code.  Also, reins runs over 600 
unit tests, but there certainly aren't 600 separate tests written in the 
source.  It uses a functors to apply to the same tests to different data 
structures.  This ensures that all of the data structures are 
observationally equivalent when they implement the same interface (which 
is especially useful for ensuring they all throw the same exception, for 
instance).

Finally, choosing a single data structure at the beginning of your project 
and embedding it in your source tree forces you to always use that data 
structure.  One of the advantages of Reins is that it includes different 
implementations that can be swapped out.  If you decide you would rather 
using a a list with fast concatenation rather than fast cons, its a one 
line change.  You don't have to go find the software, build it, ensure it 
has the same interface, ensure it behaves the same way, add it to your 
source tree, add it to your build system, and then change your uses of it.

Of course, the software is LGPL for a reason.  If you want to pull out 
parts of it, you are certainly welcome to do so.  I just won't recommend 
that path to anyone.

Cheers,
-mike

  parent reply	other threads:[~2007-09-26 15:32 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25 18:53 [ANN] OCaml Reins 0.1 - Persistent Data Structure Library Mike Furr
2007-09-25 19:14 ` [Caml-list] " Daniel Bünzli
2007-09-25 19:30   ` Mike Furr
2007-09-25 22:16     ` Cherry-picking modules (was Re: [Caml-list] [ANN] OCaml Reins 0.1 - Persistent Data Structure Library) Daniel Bünzli
2007-09-25 23:33       ` Cherry-picking modules (was " Sylvain Le Gall
2007-09-26  6:41         ` [Caml-list] " skaller
2007-09-26  7:22         ` Daniel Bünzli
2007-09-26  8:19           ` skaller
2007-09-26  8:30             ` Daniel Bünzli
2007-09-26  8:58               ` skaller
2007-09-26  9:49                 ` Daniel Bünzli
2007-09-26 10:26           ` Sylvain Le Gall
2007-09-26 11:45             ` [Caml-list] " Jim Miller
2007-09-26 12:37               ` Sylvain Le Gall
2007-09-27 10:11               ` [Caml-list] " Richard Jones
2007-09-26 12:22             ` Daniel Bünzli
2007-09-26 12:58             ` skaller
2007-09-26 16:47             ` Sylvain Le Gall
2007-09-26 22:38             ` [Caml-list] " Vincent Aravantinos
2007-09-26 22:41               ` Vincent Aravantinos
2007-09-26  6:19       ` Cherry-picking modules (was Re: [Caml-list] " skaller
2007-09-26 15:08         ` Michael Furr
2007-09-26 17:12           ` skaller
2007-09-26 17:53             ` Mike Furr
2007-09-26 19:16               ` skaller
2007-10-05 14:42               ` Adrien
2007-10-05 14:58                 ` Cherry-picking modules (was Re: [Caml-list] [ANN] OCaml Reins 0.1- " Christoph Bauer
2007-10-05 15:21                   ` Adrien
2007-10-05 19:45                     ` Cherry-picking modules (was Re: [Caml-list] [ANN] OCaml Reins0.1- " David Allsopp
2007-10-05  3:48         ` Cherry-picking modules (was Re: [Caml-list] [ANN] OCaml Reins 0.1 - " Nathaniel Gray
2007-09-26  7:03       ` Maxence Guesdon
2007-09-26  7:44         ` skaller
2007-09-26  8:53           ` Maxence Guesdon
2007-09-26 10:05             ` Daniel Bünzli
2007-09-26  8:17         ` Daniel Bünzli
2007-09-26 15:32       ` Michael Furr [this message]
2007-09-26 15:50         ` Vincent Aravantinos
2007-09-26 16:42           ` Cherry-picking modules (was " Sylvain Le Gall
2007-09-26 17:38             ` [Caml-list] " skaller
2007-09-26 17:57             ` Vincent Aravantinos
2007-09-26 17:22         ` Cherry-picking modules (was Re: [Caml-list] " skaller
2007-09-26 18:17         ` Daniel Bünzli
2007-09-26 18:45           ` Mike Furr
2007-09-26 19:21           ` skaller
2007-09-26  5:51 ` ExtLib, etc. " David Teller
2007-09-26 20:37 ` [Caml-list] [ANN] OCaml Reins 0.1 - Persistent Data Structure Library Mike Furr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.64.0709261109010.10669@loompa \
    --to=furr@cs.umd.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).