[Shootout-list] NOT ACCEPTED: Program should use exception handling.

Brent Fulgham bfulgham@debian.org
Tue, 23 Nov 2004 00:07:40 -0800


On Sunday 21 November 2004 05:56 pm, skaller wrote:
> Felix exception test says:
>
> "NOT ACCEPTED: Program should use exception handling."
>
> Thanks for giving reason at least.

Let me just say that I don't agree with this at all.  While I eventually 
admitted defeat regarding the use of structures and ingenious foo to create 
object systems for C, I have to say that disqualifying a language like Felix 
for using its in-built error handling system is not reasonable.

The key idea here is to see what the cost is to use a language's error 
handling system.  I'm not keen about _setjmp/_longjmp, but I'm not sure where 
to draw the line.  Just because a language doesn't say "Exception" in the 
source code does not mean they are not being used.  Call/CC or Common Lisp's 
escape clauses should be allowed.

> Why not make a second version of the test, in which
> the throw is only done 1/1,000,000 of the time,
> to see what the cost of *not* throwing a catchable
> exception is?

This is a good point.  ADA 95 apparently has two flavors of exceptions, one 
that incurs more cost when thrown (but is cheaper in the case you don't 
throw) and the other has a more amortized cost if you tend to throw a lot.

-Brent