News for hackers. Stuff that matters.
Re:Rust for Filesystems by aoieu on Monday July 15, 2024 @07:45AM (#40966957)
Perhaps a better approach would have been for Linus to design his own backwards-compatible and safer fork of the C language, and have the kernel gradually rewritten in that.

He's already written - with a considerable amount of collaboration of course - the world's most popular kernel and the world's most popular source control system. I expect he'd be able to do the same for a new and improved systems language if he put his mind to it.

Re:Rust for Filesystems by pjc50 on Monday July 15, 2024 @08:03AM (#40967065)
> backwards-compatible and safer

Pick one.

The safety is achieved by eliminating constructs which cannot be proven to be safe. Additionally, Rust-style safety involves adding more information explicitly to the source which otherwise has to be kept in the programmer's head: object lifetimes, lock rules (see original article), etc.

At best you end up with "first wrap all your original code in 'unsafe' and then gradually move the safety boundary", but even that is very difficult.

Re:Rust for Filesystems by fwip on Monday July 15, 2024 @08:35AM (#40967289)
Not advocating for this, but you could also imagine a C superset where all of the new features only apply in 'safe' blocks, which would be backwards-compatible, and likely safer-in-practice.
Re:Rust for Filesystems by account42 on Monday July 15, 2024 @10:59AM (#40968452)
A C variant that e.g. defined OOB access to segfault (or panic in this case) would be strictly safer while being fully compatible with all valid C code. Not that I'm advocating for such a C variant but your snide retort is simply wrong: there is plenty of room for making C safer without reinventing the wheel.
Re:Rust for Filesystems by renox on Monday July 15, 2024 @07:58AM (#40967039)
Note that the Linux kernel is already written with C 'extensions' not in pure C.