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 CAA08868; Tue, 3 Apr 2001 02:33:20 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 CAA08859 for ; Tue, 3 Apr 2001 02:33:14 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f330XBD24463 for ; Tue, 3 Apr 2001 02:33:12 +0200 (MET DST) Received: from localhost (isdnppp2.kurims.kyoto-u.ac.jp [130.54.16.103]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id JAA24867 for ; Tue, 3 Apr 2001 09:33:08 +0900 (JST) In-Reply-To: <20010402103351.1844.qmail@dionysos.informatik.unibw-muenchen.de> References: <20010402123958K.garrigue@kurims.kyoto-u.ac.jp> <3AC83117.7C3AD3C9@lri.fr> <20010402103351.1844.qmail@dionysos.informatik.unibw-muenchen.de> Subject: Re: [Caml-list] Future of labels, and ideas for library labelling To: caml-list@inria.fr X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010403093527G.garrigue@kurims.kyoto-u.ac.jp> Date: Tue, 03 Apr 2001 09:35:27 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk OK, now I have three answers calling for a more radical shift toward labels :-) Of course labels are the Right Way (yet, I don't care about trade marks). Otherwise I wouldn't have suggested to introduce them in ocaml in the first place. Here is again a long explanation. When labels were first introduced in Olabl, about 5 years ago, I did not realize it fully: this was just an experiment in how many labels you can put in a library, and how it feels to use. But then using it myself, and having students use it, I came to realize that _compulsory_ labels are really the way to go. Of course optional arguments are very nice for libraries, as everybody seems to agree, but compulsory labels on non optional arguments are the real thing, which change the programming experience (to speak Self'ish). Commutation also matters, but again it is secondary to the fact that all uses of a function will be coherently labeled. (By the way all this discussion about labels being hard to understand to beginners is of course trash. They clearly make understanding easier. But they may make the teacher's work harder :-)) After various attempts at labelling, the conclusion was that you should put as many labels as possible, with at most one non-labeled argument per function, and very often none at all. (By this standard the current labelling of the standard library is just broken.) Why such a frenzy of labels ? Nothing so surprising: natural language is full of grammatical redundancies. You don't ask why you should put an article before a name, or why a verb works with a particular preposition. That's all defined, and it helps understanding each other. Many people believe that since functional programming languages have a mathematical basis, they should look like mathematical formulae, but this is plain wrong: they should be redundant enough so that you understand them as you understand a math course. You would be surprised if the professor never reminded you of the meaning of a theorem when using it, just because it was proved once! So (compulsory) labels are the way to go. But what are labels in ocaml? Most people just consider them as an extension, like objects are. There are no objects used in the bytecode compiler, so there should be no labels there, and as a result no (compulsory) labels in the standard library. Considering the history of Caml, this seems hard to refute. The only new feature that made its way to the core is modules, and the name changed from caml-light to caml special light then. So if labels are to have the same role, people would expect a change in the name of the language itself. I'm not sure this is really what is needed now. (Wolfram talked about the freedom to stay with an older version: this is exactly what happened for the many people who went on using caml-light until recently) Another example is Haskell: type classes became the main feature of this language, so omnipresent that even the map function is overloaded. A lot of comfort was gained, but the simplicity of the core language was lost. That was basically the dillemma when merging olabl into ocaml: olabl was a different language, and I cannot see how all ocaml users could suddenly be convinced to switch to olabl. That's why I'm trying to make proposals that do not touch too directly the core of the language. Just to make it easy to everybody. I'm not sure I'm sacrificing the right way. What was the right way for olabl is not necessarily the right way for ocaml. Yet, I would not like to see labels limited to a small set of libraries, like LablTk and LablGTK. Also, these reactions surprised me a bit. I can very well see why Wolfram pushes labels: he has as much experience as me in them, and knows where they help. But Judicael and Markus had just said that they were not using label mode. They may convince people much better if they come back next week after having converted a few programs to labels mode :-) Seriously, what labels lack currently is serious users. (Well, there are some in Japan, but they are not very outspoken). Best regards, Jacques Garrigue ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr