DIP 1008 Preliminary Review Round 1

nkm1 via Digitalmars-d digitalmars-d at puremagic.com
Fri May 19 12:46:07 PDT 2017


On Friday, 19 May 2017 at 15:45:28 UTC, Mike Parker wrote:
> DIP 1008 is titled "Exceptions and @nogc".

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 :)

> Instead, we should be asking... How can allocations in Phobos 
> and user code be transferred to an allocation strategy of the 
> user's choosing/needs?

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. 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...)


More information about the Digitalmars-d mailing list