DIP60: @nogc attribute

via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 17 13:46:55 PDT 2014


On Thursday, 17 April 2014 at 19:55:08 UTC, Walter Bright wrote:
> I know that with ARC the compiler inserts the code for you. 
> That doesn't make it costless.

No, but Objective-C has some overhead to begin with, so it 
matters less. Cocoa is a very powerful framework that will do 
most of the weight-lifting for you, kinda like a swiss army 
knife. In the same league as Python. Slow high level, a variety 
of highly optimized C functions under the hood. IMHO Python and 
Objective-C wouldn't stand a chance without their libraries.

> I know it's done automatically. But you might be horrified at 
> what the generated code looks like.

Apple has put a lot of resources into ARC. How much slower than 
manual RC varies, some claim as little as 10%, others 30%, 50%, 
100%. In that sense it is proof-of-concept. It is worse, but not 
a lot worse than manual ref counting if you have a compiler that 
does a very good job of it.

But compiled Objective-C code looks "horrible" to begin with… so 
I am not sure how well that translates to D.


More information about the Digitalmars-d mailing list