From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA05398; Wed, 25 Jul 2001 17:15:59 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA05394 for ; Wed, 25 Jul 2001 17:15:58 +0200 (MET DST) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f6PFFvH23109 for ; Wed, 25 Jul 2001 17:15:57 +0200 (MET DST) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id IAA14419; Wed, 25 Jul 2001 08:15:49 -0700 (PDT) Date: Wed, 25 Jul 2001 08:15:49 -0700 (PDT) From: Brian Rogoff To: Miles Egan cc: caml-list@inria.fr Subject: Re: [Caml-list] a reckless proposal In-Reply-To: <20010724140210.B38516@caddr.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 24 Jul 2001, Miles Egan wrote: > On Tue, Jul 24, 2001 at 12:44:52PM -0700, Brian Rogoff wrote: > > I understand this desire to unify features and remove non-orthogonalities, > > but I don't like this proposal. I think it would be more interesting to > > have a language with more polymorphism in records, as well as some more > > flexibility in modules. By enhancing those aspects of the language the > > advantages of classes would be reduced. > > Overall I agree. I wonder if the inria folks are interested in making changes > in this area or if they're focusing on other things at the moment? I'll take a > look at the SML# stuff. I don't know about records, but it appears that there is work on mixin modules. While I agree that the record field problem is annoying, and definitely not a feature, it's not on my top 3 list of fixes or new features desired. Probably somewhere between a petty complaint and a nuisance. I do work with programmers who hate Caml for this very reason though! > > Of course, if you're really into confusing, errr, unifying concepts, I > > suppose we could unify modules and records too? No joke, I think a few > > language designs do this. > > As much as unifying concepts, I'm interested in identifying the "false friends" > new programmers encounter in Ocaml. Records are such "false friends" I believe. > They resemble, even in syntax, C structs and are used in some fairly similar > ways, but functionally they are quite different. I think this fact would be > more obvious and less confusing if they weren't so enticingly but superficially > familiar. Object syntax and behavior, on the other hand, is very similar to > that found in more mainstream languages and causes less confusion, I think. It also seems that you'd like to eliminate these false friends (good phrase, especially for a bilingual French-English mailing list!) by subsuming them into features that mainstream programmers know well. That would be a mistake, since you'd end up with a mainstream language. I don't think records are really such a false friend, it's just that if you want type inference the whole issue of what the type of a record field access is is a bit more complex. > Modules are another of these "false friends", I think. In most commonly-used > languages, a module is rougly equivalent to a compilation unit and corresponds > to a source file. I spent a fair bit of time learning and using Ada 95 before I hit OCaml, since at the time C++ was achieving popularity I was doing numerics and I wanted templates (which were very poorly supported in the early to mid 90s). Ada packages correspond very closely to ML modules, and there are even crude approximations to functors and signatures in Ada 95 (generic formal package parameters in Ada parlance). If you are only used to C/C++/Java and Perl/Tcl then OCaml is very different. > In these languages, a module is essentially a collection of > related types and functions. In OCaml, a structure is essentially a collection of definitions (of types, functions, classes, modules..). So it's not too different. -- Brian ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr