DIP 1008 Preliminary Review Round 1

Jack Stouffer via Digitalmars-d digitalmars-d at puremagic.com
Fri May 19 13:31:53 PDT 2017


On Friday, 19 May 2017 at 19:46:07 UTC, nkm1 wrote:
> As someone who iis interested in @nogc (more precisely: in 
> avoiding GC pauses), I like this proposal... But it looks like 
> people are concerned about 'new' becoming contextual keyword 
> (that in some contexts it allocates with GC and in others it 
> does something else). So maybe different syntax can be used? 
> How about "throw scope Exception"? ("scope" already does 
> various things :)

This syntax was already proposed and mostly rejected by the 
community. See the original thread listed in the DIP.

> But memory management is not only about allocations, it's also 
> about deallocations! Manually deallocating stuff (like freeing 
> exception objects) is error prone and bothersome.

That's why we have the GC.

> Refcounted exceptions seems to me a pretty good solution (and I 
> think the general plan for D is to use more reference counting? 
> At least, that's my impression...)

That was my impression too. However Walter has made it clear that 
@safe ref-counting of classes is not planned as he doesn't think 
it's possible. I'm unclear on the details of that, so you'll have 
to ask him.


More information about the Digitalmars-d mailing list