Re: The Case for Rust (in any system)
Date: Thu, 05 Sep 2024 21:07:00 UTC
Alan Somers <asomers@freebsd.org> wrote: > In fact, of all the C bug fixes that I've been involved with (as > either author or reviewer) since May, about three quarters could've > been avoided just by using a better language. ... > To summarize, here's the list of this week's security advisories, and > also some other recent C bug fixes of my own involvement: After checking several of these examples, I'm wondering what the code would have looked like in some "better language", where those bugs would have been avoided? E.g for the "use after free" or "unitialized memory" examples. To me, several of those bugs seem fairly complex, and not just a question of having bounds checking for arrays or a borrow checker for pointers, or something simple like that. But maybe the bugs could have been detected and prevented if the code would have been forced to be expressed in a completely different manner by some other language? Or what is your vision of how that would be accomplished? You seem to be saying that certain examples would be solved by a better language, and certain ones would not, so I suppose you do have some vision of how that would work. I'm just curious to learn more, since it is not obvious to me, and thus all the more interresting. /Kristoffer Eriksson