Comment

Comment by pjmlp

Objective-C got ARC after Apple failed to make a tracing GC work without issues when mixing frameworks of multiple origins, specially given the underlying C semantics.

So given Objective-C's semantics, having the compiler insert [... retain] and [... release] calls according to Cocoa patterns, makes more sense than the original GC idea.

Which only works for Objective-C classes that follow such patterns, not for plain structs or basic C like data types.

Swift also adopted ARC, because it needed anyway to interoperate with the Objective-C runtime.

RC is nothing new, it was the very first GC algorithm being implemented, there are many reasons why GC research moved beyond it.

Making RC algorithms achieve the same kind of performance in multi-core core using NUMA architectures (multi-level caches) is as complex as just having tracing GC algorithms, with the caveat of not handling cycles and possible stack overflows due to cascade deletions.

parent pjmlp 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton