The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: scj@yaccman.com
To: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] Recreation of the PDP-7 UNIX TMG compiler compiler
Date: Thu, 18 Nov 2021 11:01:05 -0800	[thread overview]
Message-ID: <4e700acfcc03155ba918602cc2e7569b@yaccman.com> (raw)
In-Reply-To: <CAKH6PiWZCVZaA6v0YYuWA5mYqKV3TY4kDWR+1aSGAFgPnHky_g@mail.gmail.com>

I was deeply motivated by TMG.  The good news is that you could say what 
you wanted and it just did it.  The bad news was the error handling.  
Because it was recursive if you made a syntax error the program 
backtracked and tried again.  And again.  And again.  And eventually was 
back at the first character of the input with nowhere to go.  So it 
issued one of its two messages -- "Syntax Error".   No hint as to where 
it was.  The other message was something like "Internal Error: call 
X1234".  It very much encouraged a  "write one line and compile" 
approach.  It was my moaning about this in Aho's presence that got us 
started on LR parsing and led to Yacc.

There was actually a similar problem with Yacc.  I made an attempt to 
recover from syntax errors so I could give more than one useful message 
from Yacc.  But there was a lot of cross-checking in the various 
modules, and the result was usually an internal error that I detected 
and reported.  I naively assumed that if there was a syntax error the 
user would fix that and rerun.  But instead, there was a steady stream 
of people coming in to tell me about these fatal internal errors in 
Yacc.

When I realized that 95% of those internal errors were triggered by 
syntax errors, I set a flag when there was a syntax error and if the 
flag was on I changed the internal error message to "Cannot recover from 
earlier errors."  About a week later, I gave a talk on Yacc and several 
people mentioned that Yacc used to "crash" all the time, but in the last 
week it had become much more stable...

---


On 2021-10-14 09:53, Douglas McIlroy wrote:
> Impressive indeed. And I imagine the feat will impress its brilliant
> grandparent, Bob McClure (cc'd), too.
> 
> Even though I wrote that TMG way back when, I'd never have dared to
> try resuscitating it. Thank you, Phil.
> 
> Doug
> 
> On Thu, Oct 14, 2021 at 11:56 AM Lars Brinkhoff <lars@nocrew.org> 
> wrote:
>> 
>> Phil Budne wrote:
>> > In what is perhaps best described as a crazed act, over the past two
>> > months I've worked to recreate a working TMG environment on PDP-7
>> > UNIX, including a B compiler in TMGL, currently available at:
>> 
>> Very impressive!

  parent reply	other threads:[~2021-11-18 19:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 20:53 Phil Budne
2021-10-14 15:38 ` Lars Brinkhoff
2021-10-14 16:53   ` Douglas McIlroy
2021-10-14 17:06     ` Will Senn
2021-11-18 19:01     ` scj [this message]
2021-10-14 22:42 ` Robert Swierczek
2021-10-15  1:21   ` Ken Thompson
2021-11-20 15:02 Douglas McIlroy

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=4e700acfcc03155ba918602cc2e7569b@yaccman.com \
    --to=scj@yaccman.com \
    --cc=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).