Plan for Exceptions and @nogc?

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 18 10:26:32 PST 2015


On Wednesday, 18 February 2015 at 14:46:30 UTC, Dicebot wrote:
> From my POV best proposal from last lengthy discussion was to 
> enable reference-counted non-gc-heap Exceptions. But that needs 
> a language change because RefCounted!T is a struct and thus 
> neither can be thrown nor can be part of Throwable class 
> hierarchy.
>

This is not satisfactory. First there is no safe way to refcount 
right now. Second, this has all kind of implication for the GC to 
scan the heap and so on. Finally this do not solve the type 
qualifier problem.

I don't think a language change to do this pay for itself. i 
understand the appeal, as this is probably simpler to implement 
than the alternative, but that is really building technical debt.

> Any concept that implies that exceptions an be deallocated in 
> `catch` block is absolutely unacceptable because it conflicts 
> with exception propagation from fibers - a very important piece 
> of functionality.

Exception propagate the same way between thread, which is even 
worse :)


More information about the Digitalmars-d mailing list