News for hackers. Stuff that matters.
Re:So You Want to Rust the Linux Kernel? by volta83 on Monday October 11, 2021 @10:14AM (#28828528)
> If you want good performance but don't care about precise control over the machine, write Java or C# or something high level like that. You'll be just as safe

No, you aren't.

None of these languages catch data-races, so writing multi-threaded code is pretty much as hard and error prone as in C. Other higher-level languages like Python fix this by holding a global mutex, so that using multiple threads doesn't really buy you that much there since threads always execute sequentially to avoid data-races.

This is in contrast to Rust, which allows anybody, even people without experience in low-level programming to accelerate their applications using multiple threads, without introducing bugs.

Actually, Mozilla tried to multi-thread Firefox multiple times using C++, and failed, over and over again, because every attempt would introduce subtle bugs. Rust was created to address this issue.

Re:So You Want to Rust the Linux Kernel? by Const-me on Tuesday October 12, 2021 @06:58AM (#28838252)
Rust only catches integer overflows in debug builds, my C# programs catch it everywhere. The compiler setting is off by default but it is available.

In Rust, many libraries especially the standard one have lots of unsafe code, with a history of security bugs there [1]. In C#, the standard library is written in almost 100% safe code.

About threading, while it doesn't catch all data races automatically, C# implements many useful things on the VM level. Monitor class, or memory model guarantees, are very hard to implement in languages who compile to native code.

[1] https://shnatsel.medium.com/how-rusts-standard-library-was-v...

Re:So You Want to Rust the Linux Kernel? by quotemstr on Monday October 11, 2021 @12:29PM (#28830086)
> None of these languages catch data-races, so writing multi-threaded code is pretty much as hard and error prone as in C.

All real world languages have facilities for various kinds of safe concurrency, e.g. actors and other kinds of message passing. When it comes to concurrency, Rust isn't anything special. It's not even that good.

Rust has one killer feature: memory safety without GC. Except for this feature, Rust is mediocre. If you don't need the memory safety without GC, you can use almost anything else and be better off.