Hacker News new | ask | show | jobs
by dogprez 634 days ago
I'm glad you found something you like. I just want to make it clear that the things about Rust that make it "unfriendly" are also the things that make it able to do things other languages can't do, like compile-time memory safety. Depending on what you are making, that might make little difference. I just wanted to make sure you appreciated what Rust can do that other languages can't.
1 comments

This is an article about another language that can do that.
Swift does have borrow checking: 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.

> 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.