From: Paul Winalski <paul.winalski@gmail.com>
To: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: TUHS main list <tuhs@tuhs.org>
Subject: [TUHS] Re: The 'usage: ...' message. (Was: On Bloat...)
Date: Sun, 19 May 2024 12:21:43 -0400 [thread overview]
Message-ID: <CABH=_VTh82U1bG5ys=5n+82PvXz7aGQoqTHguGaLHNP_zP+rxw@mail.gmail.com> (raw)
In-Reply-To: <CABH=_VQ=1rWgxFvE-qS5BXuJ1BN=rGN2mJ620vtBEiUouPTnBQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1864 bytes --]
Ack! I finger-fumbled and accidentally sent this message incomplete.
Here's the complete version. Sorry about that, Chief!
On Sun, May 19, 2024 at 12:18 PM Paul Winalski <paul.winalski@gmail.com>
wrote:
> On Sun, May 19, 2024 at 10:03 AM Douglas McIlroy <
> douglas.mcilroy@dartmouth.edu> wrote:
>
>>
>> Another non-descriptive style of error message that I admired was that of
>> Berkeley Pascal's syntax diagnostics. When the LR parser could not proceed,
>> it reported where, and automatically provided a sample token that would
>> allow the parsing to progress. I found this uniform convention to be at
>> least as informative as distinct hand-crafted messages, which almost by
>> definition can't foresee every contingency. Alas, this elegant scheme seems
>> not to have inspired imitators.
>>
>> The hazard with this approach is that the suggested syntactic correction
> might simply lead the user farther into the weeds. It depends on how far
> the parse has gone off the rails before a grammatical error is found.
> Pascal and BASIC (at least the original Dartmouth BASIC) have simple,
> well-behaved grammars and the suggested syntactic correction is likely to
> be correct. It doesn't work as well for more syntactically complicated
> languages such as C (consider an error resulting from use of == instead of
> =) or PL/I. And it's nigh on impossible for languages with ill-behaved
> grammars such as Fortran and COBOL (among other grammatical evils, Fortran
> has context-sensitive lexiing).
>
> Commercial compiler writers avoid this techniq
>
Commercial compiler writers avoid this technique because it turns into an
error report generator. The potential user benefit is outweighed by all of
the "your compiler suggested X as a correction when the problem was Y"
that need to be answered.
-Paul W.
[-- Attachment #2: Type: text/html, Size: 2515 bytes --]
next prev parent reply other threads:[~2024-05-19 16:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-19 14:03 [TUHS] " Douglas McIlroy
2024-05-19 16:18 ` [TUHS] " Paul Winalski
2024-05-19 16:21 ` Paul Winalski [this message]
2024-05-19 17:22 ` [TUHS] Re: The 'usage: ...' message Ralph Corderoy
2024-05-19 20:42 ` [TUHS] Re: The 'usage: ...' message. (Was: On Bloat...) Dave Horsfall
2024-05-19 23:08 [TUHS] " Douglas McIlroy
2024-05-20 0:58 ` [TUHS] " Rob Pike
2024-05-20 3:19 ` arnold
2024-05-20 3:43 ` Warner Losh
2024-05-20 4:46 ` arnold
2024-05-20 3:54 ` Bakul Shah via TUHS
2024-05-20 14:23 ` Clem Cole
2024-05-20 17:30 ` Greg A. Woods
2024-05-20 20:10 ` John Levine
2024-05-21 1:14 ` John Cowan
2024-05-20 17:40 ` Stuff Received
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='CABH=_VTh82U1bG5ys=5n+82PvXz7aGQoqTHguGaLHNP_zP+rxw@mail.gmail.com' \
--to=paul.winalski@gmail.com \
--cc=douglas.mcilroy@dartmouth.edu \
--cc=tuhs@tuhs.org \
/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).