Exception Hierarchies

Dean_Swan at Mitel.COM Dean_Swan at Mitel.COM
Tue Aug 17 16:00:40 UTC 1999



From:  Dean Swan at MITEL on 08/17/99 12:00 PM

With all the discussion of exceptions, I feel compelled to add to the din.

To the best of my knowledge, the concept of exceptions originated with
microprocessor designers.  Since I develop embedded real-time firmware for
telecomm equipment (mostly DSP stuff, but some 68k and PowerPC) as a vocation, I
spend a lot of time writing exception handlers (albeit in C or assembler).  In
almost every instance I can think of, the programmer only has the capability to
implement exception HANDLERS, and no ability whatsoever to define what will
generate an exception (excepting things like 68000 TRAP vectors).

This whole concept of users being able to define EXCEPTIONS themselves (which
seems to have really been popularized by C++ - what a horrid language)  just
seems to be a disaster waiting to happen.  Exceptions exist on embedded
processors to handle things that can not be handled in any other way, and would
usually result in a machine crash.  These include things like bus faults, divide
by zero, and the ubiquitous PowerPC Machine Check exception, and exceptions in
these environments are just a superset of what are also referred to as
interrupts.

Interrupts/Exceptions are usually externally triggered redirections of control
flow (usually a full context switch) to handle events that are in some way
deemed to be 'critical' in some way (i.e. timeliness of response, or severe
consequences for not dealing with the event immediately), and in most
environments, sources of exceptions and/or types of exceptions can be determined
a priori and remain essentially immutable.

The other danger I see in implementing user defined exceptions is that people
seem to be suggesting systems where the exception handlers run in the same
process context as the exception generator.  This also seems to be a potentially
dangerous thing to do (imho).

So, why all the excitement about exceptions?

                                   -Dean Swan







Tim Rowledge <rowledge at interval.com> on 08/16/99 08:46:14 PM

Please respond to squeak at cs.uiuc.edu

To:   Squeak mailinglist <squeak at cs.uiuc.edu>
cc:    (bcc: Dean Swan/Ogd/Mitel)

Subject:  Re: RE: Re: Exception Hierarchies




Although exception handling is a useful (even crucial) idea, it will only
become a _usable_ idea when somebody provides a system that makes it simple
and easy to do the right thing with handling them!
I've lost count of the number of times I've seen code that uses Object
errorSignal to capture a minor exception like a filestream permissions
problem - and simply ignore any other! And then there are the uses of a
handler collection that traps _all_ the signals, including halt...
A browser-like tool that makes it simple to select the proper signal or
create a new one would probably be a good start. Pervasive, well formed,
usage throughout the system would provide good examples.

It's a lot of work.

tim

--
Useful random insult:- He's not stupid; he's possessed by a retarded ghost.
Tim Rowledge:   tim at sumeru.stanford.edu (h)  <http://sumeru.stanford.edu/tim>





More information about the Squeak-dev mailing list