Hacker News new | ask | show | jobs
by username90 1849 days ago
Rust isn't a memory safe language though. Unsafe is a part of the language, so it wouldn't get that badge.
2 comments

Pretty much ever safe language has unsafe features though, either by calling out to C or something like sun.misc.Unsafe in java.
Calling unsafe libraries isn't the same thing as having unsafe language features.
Calling unsafe libraries automatically makes the calling code unsafe by definition. You cannot have a 100% safe language that also interacts with its (unsafe) environment in any way.

The language needs a way to express the lack of safety of an external library in order to clearly isolate it from the safe code sections. In Rust that's the unsafe block.

`cargo-geiger` provides nice detailed output. I found it eye-opening and it made me more conscious what dependencies to use.
unsafe{} is an explicit escape hatch so it's much easier to audit and control for. So you are simply nitpicking.