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.
