[TUHS] v7 software

Douglas McIlroy douglas.mcilroy at dartmouth.edu
Fri Dec 31 13:05:08 AEST 2021


> 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


More information about the TUHS mailing list