Plan for Exceptions and @nogc?

Chris Williams via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 17 16:54:36 PST 2015


On Wednesday, 18 February 2015 at 00:14:55 UTC, deadalnix wrote:
> On Tuesday, 17 February 2015 at 19:03:49 UTC, Chris Williams 
> wrote:
>> Every throwable function call could be assumed to have a typed 
>> result (even void functions) and if, after the return, the 
>> caller checks the type and detects that it was an error, 
>> bubbles that up, then eventually you get to wherever the 
>> catcher is.
>>
>> But so basically, the current ABI doesn't support it and 
>> there's no desire to change it? How do exceptions currently 
>> happen, if not via some official ABI declaration of how 
>> throwable methods interact with one another? The 
>> compiler/linker determines where the catcher is and inserts 
>> code to cut down the stack and perform a long jump all the way 
>> back? If so, how do scope statements work?
>
> This kind of stunt is taxing on the fast path. It can be 
> implemented as setjmp/longjmp but is more and more avoided in 
> favor of libunwind based solutions for languages that have code 
> running on unwinding.
>
> libunwind based solution is slower to unwind, but is not very 
> taxing in the fast path (only prevent some optimizations to be 
> done like tail call).
>
> This solution is a non starter perforamnce-wize for D.

I didn't mean it as a solution. As said, I was just looking for 
an intro to the topic, so that I (and others) could meaningfully 
contribute or at least understand the options. I'll look up 
libunwind and, if that has enough info for me to grok it, create 
a wiki page on the subject.


More information about the Digitalmars-d mailing list