comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: Compiler error messages
Date: 1998/01/23
Date: 1998-01-23T00:00:00+00:00	[thread overview]
Message-ID: <01bd2851$7787ea60$c0f682c1@xhv46.dial.pipex.com> (raw)
In-Reply-To: dewar.885556568@merv


Robert Dewar gives a long reply to my post about compiler error messages,
for which many thanks earnestly.  His reply is specific to GNAT (with which
I am not, in fact, very familiar).  I have no doubt that GNAT is very
clever at producing error messages, and I am not trying to criticise either
GNAT or any other specific compiler.

Robert introduces an example of a highly displaced error locus, very much a
classic case.  I will never forget the day I got an error at the end of a
multi-thousand line Pascal program -- a highly convoluted one at that --
corresponding to an actual error buried deep in the middle.  It took me
days to find it.  It still hurts just thinking about that one.  

However, I can assuredly remember many times when various 'smart' compilers
have 'guessed' an error locus, always wrongly.  They never actually help to
find the error.  In fact, good language design -- such as that of Ada -- is
the only thing which does help.

I am, in fact, a compiler writer, not a user; a fact which, of course, puts
me at a disadvantage when it comes to error messages: messages which mean a
lot to me may well be gibberish for a user.  Referring to the example
Robert gives,

   a := b & + c;

the technically correct error would be "term expected" at the plus sign. 
This is precisely what the Ada RM specifies at this point in the syntax. 
Contrary to what Robert suggests, there is no need for any guesswork or
assumptions.

Of course, this error message might not actually be very helpful to the
user, and I've no doubt that other examples would show up this idea much
more poignantly.  The essence of the problem, to me, is how to be helpful
to the user in a solid way, rather than just making a few blind stabs in
the dark as to what went wrong.  Whilst I've no doubt that certain
compilers may be very clever at making these guesses, a guess is a guess. 
I'm wanting a bit more science to it!

Once again, contributions from any and all would be most welcome!

-- 

Nick Roberts
Croydon, UK

Proprietor, ThoughtWing Software; Independent Software Development
Consultant
* Nick.Roberts@dial.pipex.com * Voicemail & Fax +44 181-405 1124 *
*** Always game for a verbal joust (usually as the turkey) ***





  reply	other threads:[~1998-01-23  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01bd278c$bea48680$9dfc82c1@xhv46.dial.pipex.com>
1998-01-23  0:00 ` Compiler error messages Larry Kilgallen
1998-01-23  0:00   ` Robert Dewar
     [not found] ` <En96AJ.JxL@world.std.com>
1998-01-23  0:00   ` Nick Roberts
     [not found]     ` <EnAqpo.2oJ@world.std.com>
1998-01-24  0:00       ` Nick Roberts
1998-01-23  0:00 ` Robert Dewar
1998-01-23  0:00   ` Nick Roberts [this message]
1998-01-23  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox