[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Zeroes and infinities



That's about the best that can be done in general.   Because 
in general, "Terminate with message" doesn't tell what to terminate
nor what the message should be nor to whom it should be directed.

Er, no.  Have you read LIA-1?  "Terminate with message" is the mode
that you MUST have seen, which terminates the program with a message.

That's all easy enough to understand in a traditional batch system
with an operator at the console or at least a programmer to read the core
dump later, but in general most programming languages don't embrace the
notion of a console or a core dump, leaving that to the operating system...
but in general,

What is "the program"?    What does "terminate" mean?
Where does the message go?    How does this apply to e.g. web services 
interacting automatically?     Or a control system located on the
wrong side of the moon?     

How is "Terminate with message" really different from 
"throw exceptionName" in annex E?     The only difference I can imagine is
that "Terminate with message" is intended not to be interceptible at
higher levels, which means that higher levels of programs that would be
robust in the face of gratuitous intermediate exceptions must diligently
guard against provoking such terminations, at great performance cost always,
even if the exceptions are rare.     That's why termination is not the default.

There is a style of performance programming:

1) try the quick algorithm that works with normal data

2) if the data wasn't normal, so exceptions were signaled, detect that,
   throw away the results, and

3) recompute with a slower algorithm that always works


This is the model of some correctly-rounded transcendental function
implementations, though the exception condition in that case 
"error bound too large to guarantee correct rounding" is not in IEEE 754.

Note that a language supporting this style of programming might not care
whether a particular platform implemented the exception detection in the middle
or at the end, by flags, traps, or checking arguments and results.
But "Terminate with message" doesn't work at all.

754 | revision | FAQ | references | list archive