3 ms·
One of the major advantages of reference counting is that it's easier to integrate with other languages. For example you can manipulate Swift objects from C via
by millstone 8y ago
One of the major advantages of reference counting is that it's easier to integrate with other languages. For example you can manipulate Swift objects from C via CoreFoundation, which then allows them to be used from C++, Rust, whatever.
GC'd languages have some support (JNI, etc) but they require handles, pinning, write barriers, etc. which ends up being more complicated and less flexible.
- cageface 8y agoRight, which is one of the reasons it makes sense for Apple to use it, since they have a lot of lower level C API to interact with. For more general purpose backend work this is not usually a major consideration though, which is one of the reasons I predict most backend work will continue to be done in a GC language.