|
|
|
|
|
by uecker
30 days ago
|
|
> Given the choice between a language that requires expert coding for minimal safety guarantees and one which can tolerate human error, I’ll take the latter all else equal. Again, I do not believe this is true. One gets a reasonable level of safety with only basic measures even in C. In practice, memory safety is also not even remotely the main issue to worry about, especially when writing a compiler. > Also, given that experts feel they can’t write correct C reliably, I’m inclined not to think I can (never mind contributors). It is not easy to write correct code in any language. See the number of CVEs in the Rust rewrite of coreutils or generally the number of issues one also sees in Rust projects (including still memory safety issues.) If at all, this means that the C experts are not naive about it. |
|
Even if you believe this is true and the experts are wrong, other languages don’t require even these “basic levels” to provide a greater degree of safety, so presumably they’re still the better choice if only for this reason (not to mention all the others).
> In practice, memory safety is also not even remotely the main issue to worry about, especially when writing a compiler.
I agree—but those other concerns (e.g., attracting developers) are overwhelmingly reasons not to use C.
> It is not easy to write correct code in any language
Right, but “impossible” and “not easy” are different, right?
> See the number of CVEs in the Rust rewrite of coreutils
How are we supposed to derive anything from this? The 44 Rust rewrite CVEs were the result of a comprehensive professional audit that Canonical paid for and which the coreutils project has never experienced. Moreover the coreutils project predates CVE trackers. If your point is “Rust doesn’t preclude logic errors”, then who are you arguing with?
> including still memory safety issues
Which of the 45 or so CVEs were memory safety?