I actually asked this on reddit but I figured I'd pose the question here because it seems like a more fitting place for the discussion. I'd actually very much like to see ARC as an alternative to GC in D. I'd literally have no more excuses to use C++ anymore if that was the case. But after reading DIP74, I can't help but think the same mistake is being repeated with ARC that was repeated with the GC.

Usually how you allocate the object has very little to do with implementation of the object itself. So why have the @safe property specified when defining the class? Why not have it as a type qualifier for the object instead? This would allow people to opt in and out of both GC and ARC where they feel fit and not force some arbitrary allocation scheme that could function just as well with GC as with ARC. Furthermore, taking this idea to the logical extreme (this part isn't necessarily required), you could have another qualifier to allow you to manage the reference type's memory yourself. Something like @nogc or @unsafe would seem appropriate.

I figured I'd ask because it seemed to make a lot sense to me. Maybe one of you could enlighten me why this wouldn't work in D's case?

Reply via email to