John R. Grout writes:

Parsing PL/I pales in comparison to generating
correct, efficient code in the presence of
condition handling.  PL/I's major influence
on C++ was as an example of how _not_ to
design a language's error-handling features.
For example, in PL/I, a condition handler is
allowed to return control to the point of
failure, enormously complicating code
generation and error handling.  In C++,
throwing an exception acts like a non-local
GO TO to the closest enclosing matching
catch (exception handler), permanently
unwinding the blocks between the throw
and catch.

This is not the place for extended discussion of the issues Mr. Grout is addressing, but it is appropriate to note that, while (a) the enforced C++ behavior he praises is easy to provide in PL/I where it is appropriate, allowing control to return to an error site for retry, as for a conversion error detected in an input that has been repaired in an ON Unit, is often much more appropriate.

The C++ scheme Mr. Grout so admires is much akin to the traffic engineer's NO LEFT TURNS sign: It resolves a local problem by displacing it elsewhere, often in aggravated form.

Moreover, neither of these notional problems, that of parsing a PL/I-like context-sensitive language and that of generating appropriate ON units for PL/I error-handling, is in fact a particularly difficult one if appropriate machinery is used. Reserved words, for example, make compilers for toy languages easy for undergraduates to construct; but the simplifications made possible by the fact that all non-assigment statements in PL/I have the same generic syntax are more important in non-toy contexts.

John Gilmore
Ashland, MA 01721-1817
USA

_________________________________________________________________
Download Messenger. Join the i’m Initiative. Help make a difference today. http://im.live.com/messenger/im/home/?source=TAGHM_APR07

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to