RE: Syntax for label, NEW PROPOSAL

From: Don Syme (dsyme@microsoft.com)
Date: Fri Mar 17 2000 - 18:03:56 MET

  • Next message: Christophe Raffalli: "Re: More about modules"

    I really don't see people clamouring for lots of labels in the standard
    library (besides the inventors of the language feature, who don't really
    count, for lots of obvious reasons - over exposure to the feature, over
    familiarity with the label names, a natural bent to program in a particular
    way that led them to the feature in the first place, self-selection as
    people who think the feature is the best thing ever).

    I reiterate my bottom line: only add labels to a particular function if you
    can strongly argue that they will actually decrease the number of mistakes
    made by typical users that are not already caught by the typechecker. Don't
    argue about "labels being good practice" - programmers don't care about what
    someone else sees as good practice (we'd all be using Ada if they did) -
    they care about getting 90% of their code right first time, which is what
    the Caml type checker already ensures.

    That is, you need to argue when and where labels are _good_, and not just
    why they are _harmless_. (And in the world of language design, no extra
    language feature is truly harmless). IMHO, one of the only functions in the
    standard library that comes close to needing labels is "blit", and I've
    already argued why it's marginal that they are even of much help there.

    Four more points:

    o The fact that you've had to resort to "modes" at all indicates something
    is wrong. The point about O'Caml is that you shouldn't have to understand
    _anything_ about labels, objects, modules or syntax modes to use the system
    as a new user. You shouldn't have to see any labels, nor have to ask "what
    are these two modes all about", nor have to try to understand why some of
    the arguments have labels and some don't.

    o The "just documentation" response doesn't really hold water, because if
    the labels were just documentation, then they would different. For example,
    "fun", being a keyword, is highly confusing and not terribly descriptive -
    any sensible prototype would probably just use "f". And C prototypes look
    _horrible_ when you have both higher order arguments and argument names.

    o A quick poll of 2 of my Standard ML friends down the corridor about what
    they think of labels going in the standard library, and they all said
    "gross".

    o To ensure "living happily together", my feeling is you should leave the
    standard library alone (though I could live with 2 or 3 functions having
    labels), but go wild with labels and variants in the places were no one
    doubts they will be useful.

    Cheers!
    Don

    -----Original Message-----
    From: Jacques Garrigue [mailto:garrigue@kurims.kyoto-u.ac.jp]
    Sent: 17 March 2000 15:23
    To: caml-redistribution@pauillac.inria.fr
    Subject: RE: Syntax for label, NEW PROPOSAL

    Having seen a number of recent messages against having labels in the
    standard library, I have the feeling that there is a lot of confusion
    here, and I would like to make a few points clear.

    * In default (classic) mode, writing labels is (and will stay) not
      required. For those users that do not like labels, or do not want to
      bother with them, or just are starting to learn ML, labels in the
      standard library are just some form of documentation, like argument
      names in C prototypes.
      Honestly, I have never heard anybody protesting against having
      argument names in C prototypes.

    * While not requiring labels, classic mode provides some support for
      them, meaning that casual users can put some labels in their
      programs if they want. This also means that any library written in
      modern mode (where labels matter) will be available with the same
      comfort in both classic and modern mode, and, more interestingly,
      according to the _user_'s taste rather than to the implementor's.

    * What we are discussing about is modern mode. This is not pedantic
      mode, this is just another typing discipline. This basically doesn't
      concern people who are not very fond of labels, and will be perfectly
      happy with classic mode.

    * Pierre expressed his concern that modern mode would make more
      difficult some nice programming style. I perfectly agree with him,
      but I think this specific problem can be solved without removing
      labels from the library.

    Looking at the messages, there are clearly people who prefer (heavily)
    labelled style, and others who prefer fewer or no labels. But they all
    agree that Caml is and should stay a great _functional_ language.
    Let's all live happily together: modern and classic mode are there for
    that!

    Jacques



    This archive was generated by hypermail 2b29 : Fri Mar 17 2000 - 19:35:24 MET