DIP60: @nogc attribute

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 22 21:33:00 PDT 2014


On 4/22/2014 12:42 PM, Michel Fortin wrote:
> On 2014-04-22 19:02:05 +0000, Walter Bright <newshound2 at digitalmars.com> said:
>
>> Memory safety is not a strawman. It's a critical feature for a modern
>> language, and will become ever more important.
>
> What you don't seem to get is that ARC, by itself, is memory-safe.

I repeatedly said that it is not memory safe because you must employ escapes 
from it to get performance.


> Objective-C isn't memory safe because it lets you play with raw pointers too. If
> you limit yourself to ARC-managed pointers (and avoid undefined behaviours
> inherited from C) everything is perfectly memory safe.

Allow me to make it clear that IF you never convert an ARC reference to a raw 
pointer in userland, I agree that it is memory safe. But this is not practical 
for high performance code.


> I'm pretty confident that had I continued my work on D/Objective-C we'd now be
> able to interact with Objective-C objects using ARC in @safe code. I was
> planning for that. Objective-C actually isn't very far from memory safety now
> that it has ARC, it just lacks the @safe attribute to enable compiler verification.

I wish you would continue that work!



More information about the Digitalmars-d mailing list