Re:Apple is rewriting Foundation in Swift
by o1y32 on Monday May 22, 2023 @05:58AM
(#36029305)
No, that's not possible. Just one example -- In Rust/C++, developer is responsible for managing the memory, while in Java/Swift etc the language does most of the work for you. This alone can fundamentally change many aspects of language design and mean completely different experience for developers
[ Parent
| on HN ]
Ah I see, I didn't know Swift was garbage collected. That makes sense.
EDIT: wait, I'm reading that swift does not have a garbage collector. I guess I don't see how it differs from Rust then.
EDIT2: ah I see, everything's a smart pointer basically and memory's released at the end (RAII-style), whereas Rust has the borrow checker (but it's still RAII-style). I guess both implement RAII ideas, but Rust seems to do it at compile time and Swift at run time.