DIP60: @nogc attribute

Michel Fortin via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 22 12:42:20 PDT 2014


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.

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.

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.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list