On Mon, Jul 20, 2009 at 7:43 AM, Nick
Johnson<nicholas.paul.johnson at gmail.com> wrote:> On Mon, Jul 20, 2009 at 10:09 AM, Mark Shannon<marks at
dcs.gla.ac.uk> wrote:
>> Andrew Haley wrote:
>> If you can make your point without any references to any C/C++ specific
>> features it might be more convincing ;)
>
> I did. ?Recall my mention of java/c#/ruby/python's finally/ensure
> blocks, or C#'s using blocks.
Another language in this category is Ada. Ada has exceptions more-or-less like
C++, and it has "finalization", which is more-or-less like C++
"destructors"
(although slightly more robust). So the requirements on the run-time system
and generated code are similar.
Ada compilers typically use the same trade-off as C++ -- near-zero cost to
enter an exception-handling region, but high cost to actually raise the
exception.
- Bob