38

Every week or so there seems to be drama about some old dude shouting about how rust in the Linux kernel is bad. Given all the open hostility, is there easier way for R4L to continue their work?

you are viewing a single comment's thread
view the rest of the comments
[-] toothbrush 48 points 1 week ago* (last edited 1 week ago)

I dont think that there is another way. They are gonna have to coexist with the old guard. The problem is, they are both right. Rust is the better language, its basically made for this task, but C runs everywhere, it has a much larger userbase, and introducing a second language into a huge low level program like Linux will make it much, much harder to maintain.

[-] cbazero@programming.dev 3 points 1 week ago

Why would you say that Rust is made for low level hardware interfacing? I am generally curious.

[-] toothbrush 6 points 1 week ago

I was only alluding to the fact that its a low level language like C, but with a more modern design and safety features, not anything specific, sorry!

[-] cbazero@programming.dev 3 points 1 week ago

I once heard that a major problem is that you have to disable or work around Rusts safety features once you write hardware interfacing code like a os kernel

[-] Rossphorus@lemmy.world 5 points 1 week ago

Not really. While working at the OS-level can typically require 'unsafe' operations a core tenet of writing Rust is making safe abstractions around unsafe operations. Rust's 'unsafe' mode doesn't disable all safety checks either - there are still many invariants that the Rust compiler enforces that a C compiler won't, even in an 'unsafe' block.

And even ignoring all of that, if 10% of the code needs to be written in Rust's 'unsafe' mode that means the other 90% is automatically error-checked for you, compared with 0% if you're writing C.

load more comments (2 replies)
load more comments (2 replies)
this post was submitted on 09 Feb 2025
38 points (100.0% liked)

Linux

6050 readers
180 users here now

A community for everything relating to the GNU/Linux operating system

Also check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS