Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Sep 2024 23:07:00 +0200 (CETDST)
From:      ske-89@pkmab.se
To:        freebsd-hackers@freebsd.org
Subject:   Re: The Case for Rust (in any system)
Message-ID:   <202409052313.aa18097@berenice.pkmab.se>
In-Reply-To: <CAOtMX2iCNX5OkdeghnbmcMrO0UYWwm4zfxFSZGznOznu%2Bmh5rA@mail.gmail.com> from "Alan Somers" at Sep 5, 24 12:09:18 pm

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <202409052313.aa18097>