Hacker News new | ask | show | jobs
by btrask 3075 days ago
To put a point on this question: should an unsafe language (or language subset) be as safe as possible, or as unsafe (i.e. powerful) as possible?
1 comments

Unsafe Rust is a superset, not a subset, incidentally.
It seems to me that "unsafe" Rust is a subset of Rust as a whole. Unless the Rust language does not support unsafe code at all?
"Unsafe" Rust is a superset because everything you can do in normal "safe" Rust, you can do within an "unsafe" block. That is, being within an "unsafe" block (which is what people mean by "Unsafe Rust") allows you to do more, not less.
> It seems to me that "unsafe" Rust is a subset of Rust as a whole.

Sure. When people say "Rust" they usually mean "safe Rust". But if we consider "Rust" as a whole, "Safe Rust", and "Unsafe Rust", then:

Rust is Unsafe Rust

Safe Rust is a subset of Unsafe Rust (and therefore Rust).