Re:Linux Rust Support
by emilfihlman on Tuesday July 06, 2021 @09:06AM
(#27747977)
All easily achievable with gcc.
Yes, we can.
Please show us how. I don't think these can be achieved within current C semantics.
In full anyway. Limited subsets? Sure, if you assign a null and immediately try to deref' it Clang and GCC will probably notice and yell at you.
Well, no. You’re talking about using all the flags and tooling like i just mentioned, which 99.99% of people don’t use every time they run a build. Even then the best and strictest of flags + Werror still falls short.
Then you still have to run extensive fuzzing and testing to trigger different paths and whatnot.
Or you could just use Rust.
Dangling pointers are not a thing.
No double free.
Forces you to think up front about what are the possible state something could be in, and so you won’t get runtime or weird UB.
lastly, to be more pedantic for everyone who is at Linus-levels, it’s like all the best static analysis and warnings/errors all rolled up natively into the language. Please don’t bombard me with “but I can just run clang’s X and get the same thing”. No you can’t, and if you did this forces you to run it regardless.