Compiler error recovery [was: Re: f*cking re module]

François Pinard pinard at iro.umontreal.ca
Fri Jul 8 12:20:38 EDT 2005


[Rocco Moretti]
> François Pinard wrote:

> > I once worked with a PL/I compiler (on a big IBM mainframe), which was
> > trying to be helpful by spitting pages of:

> >     Error SUCH AND SUCH, assuming that THIS AND THIS was meant.

> > and continuing compilation nevertheless.  It was a common joke to say
> > that PL/I would compile some random valid program out of any garbage!

> We may laugh now (and then), but it was likely a valid design decision
> at the time. [...] Error-checking-by-compiling only "works" if you
> have cheap computing power you can run attended. (Can you imagine what
> TDD would be like if you had to wait 24+ hrs between code executions?)

Of course, all granted.[1]

The only way to be really productive, in those times, was to round-robin
oneself between a dozen simultaneous projects, or so, pushing on each
one in turn while concentrating hard to avoid spoiling one run, before
resubmitting that project and moving to the next.  This kind of seek for
productivity was somehow exhausting for the mind.

Nowadays, things are infinitely easier.  Even if easier, Python is sadly
"original" in stopping at the first syntax error, probably for avoiding
all concerns about error recovery, which is not always an easy matter.
I suspect it might be easier with Python than with many other languages.

--------------------
[1] PL/I was aggressively aiming both syntactic and semantic recovery.

-- 
François Pinard   http://pinard.progiciels-bpi.ca



More information about the Python-list mailing list