DIP60: @nogc attribute

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 16 13:52:50 PDT 2014


On 4/16/2014 12:44 PM, Peter Alexander wrote:
> * Is it perhaps too early to introduce this? We don't have allocators yet, so it
> can be quite hard to avoid the GC in some situations.

Not that hard.

> * Many Phobos functions use 'text' and 'format' in asserts. What should be done
> about those?

Redo to use output ranges instead.


> * Does @nogc => nothrow?

No. They are orthogonal.


> If I'm not mistaken, throw must through a GC-allocated Throwable.
> * If the above is true, does that mean exceptions cannot be used at all in @nogc
> code?

They can use preallocated exceptions, or be templatized and infer the 
attributes. It is a problem, though.


> * I worry about the number of attributes being added. Where do we draw the line?
> Are we going to add every attribute that someone finds a use for? @logicalconst
> @nonrecursive @nonreentrant @guaranteedtermination @neverreturns

That's essentially true of every language feature.



More information about the Digitalmars-d mailing list