So why is Kotlin/native moving away from ARC? It s...
# kotlin-native
s
So why is Kotlin/native moving away from ARC? It seems like Swift gets good enough performance, and having a cycle collector on top of it surely isn’t a dramatic hinderance. In my companies performance benchmarks for real-world mobile tasks, we were seeing Kotlin and Swift perform within 1X of each-other.
b
it never used ARC
https://blog.jetbrains.com/kotlin/2020/07/kotlin-native-memory-management-roadmap/?utm_source=twitter&utm_medium=blog&utm_campaign=kotlin_native_memory I assume you're talking about:
Still, the reference-counting memory manager was easy to write to get the Kotlin/Native project started, and a cyclic garbage collector based on a trial-deletion algorithm was added to provide the kind of development experience that Kotlin programmers expect.
That's really ARC-ish, but it's GC. To some degree, GC is ARC-ish. But ARC, is compile-time generated retain/release statements (+ autorelease)
What K/N is/was doing was runtime reference counting and then using a GC to cleanup, which afaict just generally describes GC
s
ic - I guess I assumed reference counting and automatic reference counting were the same
b
Yeah the terminology is confusing because they could be referring to: • general concept of reference counting, which is typically manual • somehow automatically tracking references and using a count to do that • Apple's ARC etc. 🤷
g
Strictly speaking ARC also a type of garbage collector 😅
b
I guess if you go by dictionary definition sure, but in the Apple world, where there once was (briefly) garbage collection, ARC is not considered garbage collection