3 ms·
If we had a standard for safe C that the linux kernel could feasibly meet, then it could be a condition of future changes that it continue to be safe. As you s
by hyperpape 8y ago
If we had a standard for safe C that the linux kernel could feasibly meet, then it could be a condition of future changes that it continue to be safe.
As you say, it's pretty hypothetical on both fronts--we're not gonna be able to prove that about a C project like the kernel, and they're not gonna rewrite in Rust any time soon.
- bluejekyll 8y agoAs I see it the main benefits of C over using other languages like Rust, are generally the ease of getting access to raw memory, sharing pointers, and direct access to hardware. Rust is actually good at all of that too, but is just as unsafe. The point I’m making is that the mythical “safe C”, would have to remove many of the benefits of why people enjoy C, so why not just use Rust at that point? One variation I’ve seen is the idea of “safer C” put forward by DJB, which would remove all undefined behavior as it’s main goal. In any case, people would need to learn something new, and that seems to be a huge barrier for any language.
- vasili111 8y agoWhat DJB stands for?
- bluejekyll 8y agoSorry, Daniel J Bernstein, a pretty famous (if you follow the space) cryptologist and software engineer.
- annywhey 8y agoRemoval of undefined behavior is an explicit goal of Zig, in fact, and I see Zig as a stronger target for automatic C conversion since the semantics are intentionally closer to C. Still possible to trivially footgun, but the compiler tries to catch more edge cases. There's definitely a space for code that can't be borrow checked, at any rate.
- hyperpape 8y agoMakes sense--I agree.