Comment on What to learn next, Swift or Rust
BatmanAoD@programming.dev 1 year agoI’m not a performance expert by any means, but…it seems like the bit about there being “no situation, ever” in which a garbage collector that “worked just as well as in any other language” outperformed reference-counting GC. The things I’ve read about garbage collection generally indicate that a well-tuned garbage collector can be fast but nondeterministic, whereas reference-counting is deterministic but generally not faster on average. If Apple never invested significant resources in its GC, is it possible it just never performed as well as D’s, Java’s, or Go’s?
abhibeckert@lemmy.world 1 year ago
Chris Lattner, one of the world’s best compiler engineers and the founder of not only the Swift language but also LLVM which backs many other languages (including Rust, by the way), went into it in a nice high level but detailed discussion here:
atp.fm/205-chris-lattner-interview-transcript#gc
Chris briefly talks about the problems in the Apple GC implementation, but quickly moves onto comparing ARC to the best GC implementations in other languages. The fact is they could have easily fixed the flaws in their GC implementation but there just wasn’t any reason to. ARC is just so much better.
Apple’s GC and ARC implementations were both implemented at about the same time, and when ARC was immature there were situations where GC worked better. But as ARC matured those advantages vanished.