DIP60: @nogc attribute

via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 20 22:38:17 PDT 2014


On Sunday, 20 April 2014 at 14:38:47 UTC, Frustrated wrote:
> Why not allow one to define their own attributes from a 
> generalized subset and then define a few standard ones like 
> @nogc.
>
> i.e., instead of having to define specific attributes every few 
> years to satisfy some new thing, why not just abstract the 
> process.
>
> Attributes, I believe, are essentially relationships between 
> parts of code?
>
> If so, then one simply has to implement some generic way to 
> specify the attributes and properties of the relationship to 
> the compiler. Then anyone would have the tools to define and 
> use these attributes as they wish.

This could be very powerful, but I think you would need to put 
attributes in namespaces if you expand their usage.

You could also get better concurrency warnings/optimization if 
you could distinguish between reads/writes to specific types, 
type members, globals, and function calls and tie it to mutexes.

Unfortunately, it isn't sufficient, since you often want to tag 
sets of instances, not sets of definitions (which is what 
attributes do, it creates sets of defs and give the set a name).




More information about the Digitalmars-d mailing list