3 ms·
> unavoidable It's not possible to tell, this question is far too broad. And "unavoidable" is a very strong statement. > And why is there a need to "defend" t
by steveklabnik 10y ago
> unavoidable
It's not possible to tell, this question is far too broad. And "unavoidable" is a very strong statement.
> And why is there a need to "defend" the idea that it isn't?
I'm not; I'm saying that the rust-lang/rust repo is going to have a much higher percentage of unsafe than a random Rust repo. Most applications have no unsafe, most libraries have little to no unsafe. Some libraries have a lot of unsafe.
That is, you chose the compiler as something intended to be representative, I don't think that's accurate.
- AsyncAwait 10y agoThe way I originally meant the "unavoidable", (in response to a comment that there's unsafe code in the Rust compiler), is that in some cases, you'll always need unsafe, since some operations are inherently unsafe, (like writing bytes directly to hardware). This due to the nature of computers, the lower level the code gets, the more likely it is that some unsafe will be needed, not because of any fault of Rust, but because of the nature of computer hardware. Therefore I meant it as in; since a compiler is relatively low-level project, some unsafe code is (most likely) unavoidable, due to the task at hand. The other poster seemed to take the unavoidable comment to mean something wider than what I was talking about.