this post was submitted on 21 Feb 2025
208 points (94.4% liked)

Technology

63082 readers
3556 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
 

Greg Kroah-Hartman... urged fellow contributors to embrace those interested in contributing Rust code to improve the kernel.

"Adding another language really shouldn't be a problem... embrace the people offering to join us

Thoughts on this?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 22 hours ago (3 children)

In my mind, introducing Rust would only make sense if:

  1. There was a serious lack of current kernel developers (which I don't think there is)
  2. New hardware and tech was evolving at a rate that the Linux Kernel could not keep up (again, I don't think this is am issue)
  3. The end goal is to migrate the entire Kernel to Rust.

Regarding point 3, having both C and Rust really only makes sense as a transition phase (measured in years) - as it would require kernel developers to be savvy in both C and Rust, or would force developers to stay within whatever domains were implemented in C or Rust.

[–] [email protected] 11 points 16 hours ago
  1. There was a serious lack of current kernel developers (which I don't think there is)

Maybe not at the moment, but my understanding is that the pool of qualified C programmers is shrinking rapidly, because the old guard is all ageing out and there simply are not enough intermediate developers coding in C at the level that Kernel development requires.

Having a larger (and growing) pool of upcoming developers interested in systems programming and software excellence is one of the explicit stated reasons that Linus et al. considered Rust in the first place.

[–] [email protected] 15 points 20 hours ago (2 children)

it would require kernel developers to be savvy in both C and Rust

From my experience knowing how both C and rust works makes you a better developer in both languages.

[–] [email protected] 8 points 16 hours ago

Learning Rust made me a better C# programmer.

[–] [email protected] 3 points 18 hours ago (2 children)

Oh absolutely, but you could argue the same for learning lisp or mastering any functional programming language (list comprehensions, etc). It will improve your design patterns when you go back to an object oriented language with some elements of functional programming.

[–] [email protected] 1 points 8 hours ago

Again from my experience, knowing lisp (yay guix and emacs) definitely helps me write more elegant code in every language.

I also have to explain almost every single thing I write in code review.

[–] [email protected] 6 points 15 hours ago (1 children)

Nah it's a different axis. Rust doesn't have a GC, you do need to think about memory, it's just that the compiler generally enforces things for you. You learn to think like borrowck thinks because you don't want to get yelled at. Going back to C then you suddenly mistrust a lot of code a lot more, and rightly so.

[–] [email protected] 3 points 12 hours ago

Exactly. The kinds of things Rust yells at you for, you should consider changing in C as well.

[–] [email protected] 9 points 21 hours ago (1 children)

What's in your mind does not coincide with the professional experience of Greg KH. You shoyld read what he had to say on the subject.

[–] [email protected] 1 points 18 hours ago (1 children)

What?!? Actually, read the article? What is this, Reddit? /s

Seriously, though - let me spin the question around: what, in your mind, overlaps with what Greg said?

(plus, OP was just interested in people opinions - not whether they align/contradict with Greg, Linus, etc)

[–] [email protected] 5 points 18 hours ago (2 children)
[–] [email protected] 4 points 12 hours ago

For the lazy, I liked these parts:

Rust isn't a "silver bullet" that will solve all of our problems, but it sure will help in a huge number of places, so for new stuff going forward, why wouldn't we want that?

...

Yes, I understand our overworked maintainer problem (being one of these people myself), but here we have people actually doing the work!

The whole thing is great.

[–] [email protected] 4 points 18 hours ago

To add something to this: linux has avoided internal SPIs for a long time. It's often lauded as one of the reasons it hasn't ossified.

However, some subsystems have a huge amount of complexity and hidden constraint in how you correctly use them. Some of that may be inherent, but more of it will be accidental.

Wrapping type-erased shims around this that attempt to capture (some of) those semantics shines a light onto the problem. The effort raises good technical questions around whether the C layer can be improved. Where maintainers have approached that with an open mind, the results are positive for both C and Rust consumers. Difficult interfaces are a source of bugs; it's always worth asking whether that difficulty is inherent or accidental.