From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,79e55eadd97001c2 X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Compiler error messages Date: 1998/01/23 Message-ID: <01bd2851$7787ea60$c0f682c1@xhv46.dial.pipex.com>#1/1 X-Deja-AN: 319040944 Content-Transfer-Encoding: 7bit References: <01bd278c$bea48680$9dfc82c1@xhv46.dial.pipex.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Organization: UUNet UK server (post doesn't reflect views of UUNet UK) Newsgroups: comp.lang.ada Date: 1998-01-23T00:00:00+00:00 List-Id: 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) ***