caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: yminsky@cs.cornell.edu
Cc: caml-list@inria.fr
Subject: [Caml-list] Future of labels, and ideas for library labelling
Date: Mon, 02 Apr 2001 12:39:58 +0900	[thread overview]
Message-ID: <20010402123958K.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <Pine.LNX.4.30.0103302228570.1705-100000@dragonfly.localdomain>

More answers, and more prespectives.
That's all very nice.

Globally it seems that almost everybody would prefer a single mode.
This is also my point of view: staying with two "equal" modes is
confusing.

Originally this was an attempt to keep most of the progress made in
olabl (with label mode) for people with an olabl background, while the
classic mode was intended to be the main mode for people used to
ocaml. I hoped that maybe just a few people might switch to label
mode, and more importantly classic mode users would start using labels
in classic mode. This is the lack of progress in this last direction
that makes me thing this will not work as well as I hoped: there is
little point in having labels in the standard library if most 3rd
party libraries do not labelize their APIs. Then it is better to have
one single community adapt slowly.

This said, at last we got an answer from a "happy classic mode user".
At least my attempt was not completely absurd :-)

From: "Yaron M. Minsky" <yminsky@cs.cornell.edu>
> I make heavy use of labels in classic mode both for the
> extra type safety it provides and for documentation.  I
> find it to be extremely useful, and would be sad to see
> classic mode go. I've never felt a great need for commuting
> of non-optional arguments.  LablTk, at least, seemed quite
> usable in classic mode.
> 
> The idea of stripping labels out of the standard library
> seems like a mistake.  The main thing I like about labels
> is the extra safety they provide.  For example, the ~key
> and ~data labels for the function in Map's iter is very
> useful, particularly when the key and data happen to be the
> same type.

Thank you very much. I was starting to feel a bit depressed about the
outcome of the classic mode.

Still, if there is only one mode to keep, I think it is better to keep
the label mode, both because it is more powerful (commutation matters
for some users) and because it is better understood theoretically
(cf. the silly soundness problem in classic mode).

But if we manage well the transition, I believe we can keep most of
the advantages of classic mode, while getting labels out of the way of
beginners.

First, concerning the standard library, an idea would be to first
remove all labels from the default versions, but then add labelized
versions of some specific functions with a different name (adding a
"'" for instance).
I mostly think of: Pervasives.output', Pervasives.input',
Pervasives.really_input', Array.blit', String.blit';
and maybe also String.sub', String.fill', Buffer.add_substring',
Hashtbl.add', Map.add'.
Since their number is very small, this would not mean too much code
increase.
If we have these functions, then labellers would probably be happy
with a Stdlabels module containing just labelized version of List and
Array. (Keeping this compatibility module small is good to avoid
confusion).

However, while the duplication approach (at a function or module unit)
seems to be the only possible for the standard library, it would be
awkward for other libraries.
So the next question might be, are people ready to have some mandatory
labels in the Unix library? And how much?
Removing labels from the Unix library makes code less redable, and
more error prone, particularly since many arguments have the same
type. (See how easier it was to understand the last code snippet
posted on this list, where Unix.create_process was used with labels.)

The graphics library being more beginner oriented, I'm not sure
keeping labels there would be a good idea.

Last, there would still be a "nolabel" mode left, but this would be
mostly for technical reasons, and would not be explicitly supported
anymore after a transition period.

Jacques Garrigue

P.S.
A few other points from the orginal poster.
> I agree that having ocaml have one standard mode would be
> best, if possible.  If there continue to be two modes, I am
> strongly in favor of a pragma for specifying the mode on a
> file-by-file basis.
Second request. If we stay with two "equal" modes, that may get
through.

> (On another note, it would be lovely if one of these days
> ocaml could move to something like the alternative syntax
> shipped with camlp4.  There are a number of bits of the
> caml syntax that are quite counterintuitive, most of which
> are fixed with the alternative syntax.)
That would be much harder for compatibility reasons.
Yet I understand camlp4 might get into the standard distribution.
Maybe not so nice for people attached to a unique mode, but if you
don't care that may become a real alternative.
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-04-02  3:52 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-31  3:40 [Caml-list] Future of labels Yaron M. Minsky
2001-04-02  3:39 ` Jacques Garrigue [this message]
2001-04-02  7:58   ` [Caml-list] Future of labels, and ideas for library labelling Judicael Courant
2001-04-02  8:50     ` Markus Mottl
2001-04-02 10:33     ` kahl
2001-04-03  0:35       ` Jacques Garrigue
2001-04-03  1:36         ` Kipton M Barros
2001-04-03  1:52         ` Patrick M Doane
2001-04-03  3:53           ` Jacques Garrigue
2001-04-03  5:10             ` Patrick M Doane
2001-04-03  9:30               ` Jacques Garrigue
2001-04-03  8:52             ` Xavier Leroy
2001-04-03  9:34               ` Judicael Courant
2001-04-03  9:54               ` Jacques Garrigue
2001-04-03 12:59                 ` Jean-Christophe Filliatre
2001-04-03 13:11                   ` [Caml-list] ocaml, java, rmi and jini Martin Berger
2001-04-03 19:23                     ` Chris Hecker
2001-04-03 20:50                       ` Gerd Stolpmann
2001-04-06  9:40                         ` Sven LUTHER
2001-04-06 20:57                           ` Gerd Stolpmann
2001-04-03 21:06                       ` martinb
2001-04-06 15:03                     ` Xavier Leroy
2001-04-03 14:06                   ` [Caml-list] Future of labels, and ideas for library labelling Jacques Garrigue
2001-04-03 14:12                     ` Daniel de Rauglaudre
2001-04-03 14:42                       ` Claude Marche
2001-04-04 19:18                     ` Gerd Stolpmann
2001-04-03  9:55               ` Ohad Rodeh
2001-04-03 18:06                 ` [Caml-list] Example of Ocaml-syntax problem with ; Mattias Waldau
2001-04-04 15:15                 ` [Caml-list] Suspending threads Ohad Rodeh
2001-04-04 17:28                   ` Vitaly Lugovsky
2001-04-06 13:21                   ` Xavier Leroy
2001-04-03 12:02               ` [Caml-list] Future of labels, and ideas for library labelling Dave Mason
2001-04-03 13:43               ` Francois-Rene Rideau
2001-04-03 14:23                 ` Daniel de Rauglaudre
2001-04-03 13:43               ` Frank Atanassow
2001-04-03 13:58               ` Joshua D. Guttman
2001-04-03 16:52               ` Eric C. Cooper
2001-04-09  9:05                 ` John Max Skaller
2001-04-09  7:29             ` John Max Skaller
2001-04-03  8:07         ` Judicael Courant
2001-04-03  6:55     ` Chris Hecker
2001-04-03 18:13       ` [Caml-list] Generics? Brian Rogoff
2001-04-03 20:12         ` Chris Hecker
2001-04-10 16:48           ` John Max Skaller
2001-04-09  8:11       ` [Caml-list] Future of labels, and ideas for library labelling John Max Skaller
2001-04-09  9:21         ` Jacques Garrigue
2001-04-09 15:06           ` Fergus Henderson
2001-04-10 18:49           ` John Max Skaller
2001-04-09 19:54         ` Chris Hecker
2001-04-10  3:37           ` Jacques Garrigue
2001-04-10  7:42             ` Judicael Courant
2001-04-10  8:25               ` Jacques Garrigue
2001-04-10  8:46               ` Claude Marche
2001-04-10 10:09                 ` Jacques Garrigue
2001-04-10 14:42                   ` Lionnel Maugis
2001-04-10  9:06             ` François-René Rideau
2001-04-11 15:34               ` Jacques Garrigue
2001-04-11 17:48                 ` Dave Mason
2001-04-12 12:39                 ` [Caml-list] How do I define prog1? Mattias Waldau
2001-04-12 14:22                   ` Vitaly Lugovsky
2001-04-12 17:53                     ` William Chesters
2001-04-12 15:15                   ` Sven LUTHER
2001-04-12 16:14                     ` Mattias Waldau
2001-04-12 15:21                   ` Maxence Guesdon
2001-04-12 15:47                   ` Stefan Monnier
2001-04-17 20:04                     ` Chris Hecker
2001-04-10 22:43             ` [Caml-list] Future of labels, and ideas for library labelling Brian Rogoff
2001-04-11  8:29               ` Jacques Garrigue
2001-04-11  9:44                 ` Anton Moscal
2001-04-11 13:16                 ` Didier Remy
2001-04-11 15:11                   ` Jacques Garrigue
2001-04-03  7:27 Arturo Borquez
2001-04-03 16:39 John R Harrison
2001-04-04 16:37 Dave Berry
2001-04-11 10:48 Francois-Rene Rideau
2001-04-17 11:53 Poigné

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=20010402123958K.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=yminsky@cs.cornell.edu \
    /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).