3 ms·
The major difference would be that future versions would be in safe Rust as well. All code written after that point would be safe. What you say is true for a s
by bluejekyll 8y ago
The major difference would be that future versions would be in safe Rust as well. All code written after that point would be safe.
What you say is true for a single point in time, not for the long-term future.
But, I would say this is probably infeasible, so theorizing too much about it seems a little wasteful. If the Linux maintainers, Linus et al, suddennly decided to convert to Rust, it would probably done incrementally, module by module. But it’s unlikely to happen given past statements.
- hyperpape 8y agoIf 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.