caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: John Carr <jfc@MIT.EDU>
Cc: Caml-list List <caml-list@inria.fr>
Subject: Re: [Caml-list] If OCaml were a car
Date: Sun, 19 Aug 2007 18:07:16 +0100	[thread overview]
Message-ID: <20070819170704.GA10089@furbychan.cocan.org> (raw)
In-Reply-To: <200708191443.l7JEhEQ8007374@psi-phi.mit.edu>

On Sun, Aug 19, 2007 at 10:43:14AM -0400, John Carr wrote:
> > Maybe I ride this car too often to realize (or I'm dumb) but I don't  
> > get the joke about controls.
> 
> OCaml has a badly designed syntax processed by a badly implemented
> parser feeding into a backend that generates poor error messages.
> All this makes the language hard to use.

I think this is a little bit of an exaggeration, but there is some
truth to it.

It's not likely that the syntax can be changed (how is the revised
syntax doing lately?) but there is one error message which could be
fixed.  When I worked at Merjis a colleague got frustrated to the
point of virtually giving up the language at the error message "Foo
makes inconsistent assumptions over Bar"[1].  It is literally useless:
it does not describe what it means, what files are involved which are
inconsistent, what their MD5 sums are or should be, and lastly it
doesn't say how to fix the problem (which generally involves
recompiling libraries).

On the up side, OCaml does show you the range of characters within the
line where the error happens.  This is something I now really miss
when using gcc / C code.

> Anybody else learn C using pcc on Unix?

Using the traditional K&R compiler for OS-9/68k and later using pcc on
Unix.  The OS-9 compiler only had about 10 different error messages
that it could print (I remember they were listed on a short page in
the manual).  ocamlopt really is miles better :-)

> Unfortunately, I didn't think to start cataloging compiler error
> messages and their causes when I started learning the language.
> I did send one anomaly to the list about parsing of semicolons.

I tell beginners that most code they write should be within a toplevel
statement:

  let _ =
    ...

or (better):

  let () =
    ...

That basically gets rid of any ; vs ;; issues.

On the subject of cataloging error messages see:
http://www.ocaml-tutorial.org/common_error_messages

Rich.

[1] I forget the precise message because hopefully my terribly
complicated dependency rules for OCaml on Fedora make it impossible
to happen, so I can't recreate it here!
http://fedoraproject.org/wiki/Packaging/OCaml#head-0c27c921de0c32d391ea39fffcbbacbd28ad10ca

-- 
Richard Jones
Red Hat


  parent reply	other threads:[~2007-08-19 17:07 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-18 19:21 Richard Jones
2007-08-18 20:24 ` [Caml-list] " Jeff Meister
2007-08-18 21:32   ` Michael Vanier
2007-08-19 11:50     ` Daniel Bünzli
2007-08-19 11:59       ` Erik de Castro Lopo
2007-08-22  5:50         ` Luca de Alfaro
2007-08-22  8:13           ` Jon Harrop
2007-08-22  9:20             ` Jacques Garrigue
2007-08-24  2:54           ` Nathaniel Gray
2007-08-25 19:45             ` Oliver Bandel
2007-08-19 14:43       ` John Carr
2007-08-19 16:22         ` brogoff
2007-08-19 17:07         ` Richard Jones [this message]
2007-08-19 17:19           ` Stefano Zacchiroli
2007-08-22  6:04             ` Luca de Alfaro
2007-08-19 20:51           ` Vincent Hanquez
2007-08-21  8:05           ` David Allsopp
2007-08-21 18:33             ` Richard Jones
2007-08-19 20:30         ` Tom
2007-08-19 21:45           ` skaller
2007-08-20  3:37             ` Jon Harrop
2007-08-20  6:26               ` skaller
2007-08-20 10:00                 ` Joerg van den Hoff
2007-08-21 12:03                   ` Florian Hars
2007-08-20  6:54               ` skaller
2007-08-20 19:54       ` Oliver Bandel
2007-08-20 20:27         ` David Allsopp
2007-08-20 20:50           ` Ulf Wiger (TN/EAB)
2007-08-21 10:56             ` Joerg van den Hoff
2007-08-20 21:13           ` Oliver Bandel
2007-08-21  0:47         ` skaller
2007-08-21  9:51           ` Oliver Bandel
2007-08-21 10:30             ` skaller
2007-08-21 18:57               ` Richard Jones
2007-08-22  2:49                 ` skaller
2007-08-22 11:33                   ` Thomas Fischbacher
2007-08-21 14:46             ` Business Adoption of Ocaml [was Re: [Caml-list] If OCaml were a car] Robert Fischer
2007-08-21 15:09               ` Brian Hurt
2007-08-21 15:48           ` [Caml-list] If OCaml were a car brogoff
2007-08-19 18:15 [caml-list] " Mike Lin

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=20070819170704.GA10089@furbychan.cocan.org \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    --cc=jfc@MIT.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).