Why exceptions for error handling is so important

via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 13 09:38:36 PST 2015


On Monday, 12 January 2015 at 20:07:17 UTC, deadalnix wrote:
> On Sunday, 11 January 2015 at 13:06:27 UTC, Dicebot wrote:
>> What is your opinion of approach advertised by various 
>> functional languages and now also Rust? Where you return error 
>> code packed with actual data and can't access data without 
>> visiting error code too, compiler simply won't allow it.
>
> Rust has an approach very similar to exception, but they do not 
> unwind and trash the whole task instead. Under the hood, it is 
> exception, but tend to be faster as you don't go through the 
> landing pad/personality function dance, but do not 
> fundamentally differ.

I think it does unwind (i.e. call destructors), but the exception 
cannot be called and ultimately will lead to task failure. At 
least this was the case some time ago, maybe it has changed?


More information about the Digitalmars-d mailing list