From: | federation2005@netzero.com |
Newsgroups: | comp.compilers |
Date: | Wed, 26 Mar 2014 17:39:25 -0700 (PDT) |
Organization: | Compilers Central |
References: | 14-03-020 14-03-023 |
Keywords: | code |
Posted-Date: | 26 Mar 2014 20:55:36 EDT |
On Tuesday, March 11, 2014 12:56:01 PM UTC-5, George Neuner wrote:
> The modern term is "exception". See also "non-local" control
> transfer, exit and/or return, and "escape" or "backtracking"
> continuation.
Right, the contemporary (not "modern") [Note 1] notion is the
catch-throw paradigm. I like to think of it as the "cap and trap"
mechanism.
I believe it originates with Prolog in the 1970's, since (a) catch and
throw are part of Prolog's library of built-in functions, and (b) the
multi-level breakout has always been an integral part of its run-time
system.
Some C compilers implement it as well, not just C++. And in more
recent times (i.e. since the late 20th century) it's found its way
directly in the CPUs' architectures as a kind of alternative to the
"interrupt".
The idea may also be motivated, in part, by the Curry-Howard
isomorphism, which relates the "AND", "OR" and "IF-THEN" connectives
of Intuitionist logic respectively to the product, union and function
types. When the scope of the correspondence is extended to classical
logic, it connects Pierce's Rule to the catch-throw mechanism. Look
under the Wikipedia entry, for instance, which also points to the
call/cc mechanism of Scheme and to the related notion of continuation
passing.
Note 1:
USENET articles are read as much as 33 years after they're written (so far),
by an audience who will see "modern" as parochially "presentist", i.e. 33
years dated. Google's people have been guilty of this too, lately.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.