10 ms·
No, sorry, it's not https://doc.rust-lang.org/1.8.0/book/references-and-borrowing.html https://doc.rust-lang.org/1.8.0/book/references-and-borrowin...
by dogprez 2y ago
No, sorry, it's not https://doc.rust-lang.org/1.8.0/book/references-and-borrowing.html https://doc.rust-lang.org/1.8.0/book/references-and-borrowin...
- astrange 2y agoSwift does have borrow checking: https://www.swift.org/blog/swift-5-exclusivity/ https://www.swift.org/blog/swift-5-exclusivity/ Basically the difference is that Swift's is more implicit, happens more at runtime, and it will make some programs work via copy-on-write that Rust would reject. So that's obviously more limiting. It's more flexible when you can allocate memory freely, but it doesn't work if you can't.
- dogprez 2y ago> happens more at runtime Bingo, that's the difference. That's why I said "compile-time memory safety". This is what Rust gives you for your trouble, zero (runtime) cost for memory safety.