Re:Crafting Self-Evident Code with D
by daaaaaaan on Tuesday October 03, 2023 @01:00PM
(#37754560)
Swift doesn't have garbage collection.
[ Parent
| on HN ]
Re:Crafting Self-Evident Code with D
by RcouF1uZ4gsC on Tuesday October 03, 2023 @02:07PM
(#37755463)
Refcounting is a form of garbage collection. While C++ and Rust also have refcounting, it is the default memory management mode in Swift in a way that it is not in C++ and Rust (where the defaults are more using stack based or unique_ptr/Box before reaching for refcounting).
No, it's not. Refcounting CAN be a garbage collection algorithm, but in Swift it's deterministic and done at compile time. Not to mention recently added support for non-copyable types that enforces unique ownership: https://github.com/apple/swift-evolution/blob/main/proposals...