[LispM-Hackers] Error handling
John Morrison
jm@mak.com
Mon, 09 Apr 2001 23:49:02 -0400
Hi;
"James A. Crippen" wrote:
> You don't like try/catch? :)
You know, I must confess I haven't used it/them much outside of, outside
of, outside of (shudder) Ada. Compiler support has been so spotty we
don't use them at the Day Job (portability Uber Alles).
> What in particular was giving you headaches with exceptions then?
When I was building "raw," completely and totally self-contained binary
executables for running on bare iron, I got all sorts of unresolved
external references to libc (until I told the compiler to disable
exception handling. They seemed to involve exception stack maintenance
and stack cleanup -- I seem to recall the compiler emitting calls to
libc to set up try/catch blocks. However, it's been a couple of years,
and I didn't really try to chase it down very far. I just blew it off
entirely and lived quite happily without it. I do not remember even
figuring out whether it was popping frames off a single stack or whether
it was walking a separate exception stack.
> I honestly think that the error system can be rewritten to include support
> for bare metal later on rather than hampering all the other systems out
> there whose ports would benefit from exceptions. But if you can convince
> me otherwise (or come up with a better solution) then as usual I'm
> perfectly willing to abandon this idea.
In general, I just try and adhere to the KISS principle. If I knew
exactly what the benefits were (I have tried to explain the complexity
costs in the bare iron case -- although I confess I do not have a good
handle on the cost of setting up try and catch blocks in terms of clock
cycles) then I would feel more comfortable with making a decision.
-jm
--
==== John Morrison
==== MAK Technologies Inc.
==== 185 Alewife Brook Parkway, Cambridge, MA 02138
==== http://www.mak.com/
==== vox:617-876-8085 x115
==== fax:617-876-9208
==== jm@mak.com