From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA27569 for caml-redistribution; Mon, 25 Jan 1999 20:16:34 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA27219 for ; Mon, 25 Jan 1999 13:46:07 +0100 (MET) Received: from link.csem.ch (link.csem.ch [138.131.145.25]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id NAA23984 for ; Mon, 25 Jan 1999 13:46:05 +0100 (MET) Received: from exchsrv.csem.ch by link.csem.ch; Mon, 25 Jan 1999 13:46:26 +0100 (MET) Received: from CODER (coder.csem.ch [138.131.12.118]) by exchsrv.csem.ch with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2232.9) id XHFMHJBM; Mon, 25 Jan 1999 13:45:32 +0100 To: caml-list@inria.fr Subject: Re: Looking for a nail References: <99012415253804.01196@maya> Mime-Version: 1.0 From: Michel Schinz Date: 25 Jan 1999 13:45:34 +0100 In-Reply-To: Miles Egan's message of "24 Jan 1999 22:43:16 +0100" Message-ID: User-Agent: Gnus/5.070063 (Pterodactyl Gnus v0.63) Emacs/20.3 Sender: weis Miles Egan writes: [...] > 1. Extend OCaml's Unix library. What's already there is very useful, > but there are quite a few functions missing. I'd be happy to help > fill this out, although I'm new enough to OCaml and functional > programming that I'm still not sure if some Unix functions were > omitted because of their stateful semantics. I think it would be nice if you took a look at scsh for that part. Scsh is a Scheme interpreter with a complete Posix interface. The design of scsh is really great IMHO and you could take many ideas from it (mostly because Scheme is also a functional language, and the design of scsh is also quite functional). However, porting the complete scsh design to CAML is not trivial, since CAML (at least Objective CAML) doesn't have a macro system, and Scheme's macros are heavily used in scsh. Anyway, the scsh page is at http://www-swiss.ai.mit.edu/scsh/ [...] > I'd appreciate any criticisms of these projects or any suggestions > for others. Here is a "big" suggestion: what I'd really like to see for OCaml is a good and consistent data structure library. The one shipped with OCaml is quite good, but there are some things I do not like about it: - some parts are "imperative" (Array, Hashtbl, ...), while others are "functional" (Set, Map, ...), - the interface of some of the modules are not as complete as one might wish (in almost all of my projects, I end up writing some basic functions, like list partitioning, ...), - the interface of the different modules is not always consistent (e.g. in the Map module, the map is always given as the last parameter, while in the Hashtbl module, the table is given as the first argument, and that is confusing sometimes [and sometimes it also prevents the use of partial application]), - none of the modules use the OO features of OCaml. So, what I would really like to do (if only I had time) is: 1. take a good look at many good standard libraries of many languages, functional or not, object-oriented or not (e.g. Haskell, MIT Scheme, Common Lisp, C++'s STL, Eiffel, Okasaki's book, ...) and identify the most important data structures and the important operations that can be performed on them, 2. design two different versions of the library: one purely applicative, and the other one with in-place modification (note that these two versions could be different, because some data structures might not be efficient or interesting enough in the two versions; however, it would be great if the two designs were as similar as possible), 3. implement these two versions of the library, 4. document them thoroughly (e.g., give the complexity of every function, ...). I'm still unclear about the OO features of OCaml, so I do not know whether they should be used or not for these libraries. Designing a good library is usually really hard, but I think that it's a crucial point. C++ for example has almost become usable now that the STL exists. And one of the main reasons why Common Lisp is usually preferred to Scheme for big applications is that the former has a good standard library (which is in fact part of the language itself) while the latter has none (yet). Michel.