The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
To: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] v7 software
Date: Thu, 30 Dec 2021 22:05:08 -0500	[thread overview]
Message-ID: <CAKH6PiV36dr6twqrEKRgTFRj_BQfAUEsKfXfD5ohbf31dpybZg@mail.gmail.com> (raw)

> Joy’s original 2BSD tape will give you UCB Pascal.

While I agree with Kernighan that Pascal is not my favorite
programming language, UCB Pascal is my favorite compiler because of
its spectacularly good syntax diagnostics. The diagnostics are
automatically generated, so they have a completely consistent style
and never go down rabbit holes trying to explain an error.

The UCB trick is to report the exact spot where LR parsing chokes and
suggest a canonical alternate token that allows progress. This simple
strategy is startlingly effective; the compiler taught me Pascal in an
evening.

It occurred to me that Pascal would be a suitable language in which to
express a certain algorithm.  Having skimmed the Pascal report a year
or more earlier, I knew it was a pretty typical language, so I grabbed
a sample program from somewhere and plowed ahead. I made mistake after
mistake, but every diagnostic was instantly suggestive. By the end of
the session I had a polished working program. In due time it was
accepted for publication.

Doug

             reply	other threads:[~2021-12-31  3:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-31  3:05 Douglas McIlroy [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-30 22:10 Will Senn
2021-12-31  1:21 ` Clem Cole

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=CAKH6PiV36dr6twqrEKRgTFRj_BQfAUEsKfXfD5ohbf31dpybZg@mail.gmail.com \
    --to=douglas.mcilroy@dartmouth.edu \
    --cc=tuhs@minnie.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).