News for hackers. Stuff that matters.
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).
Re:Crafting Self-Evident Code with D by daaaaaaan on Tuesday October 03, 2023 @02:09PM (#37755492)
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...