215

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
[-] Buffalox@lemmy.world 10 points 1 day ago* (last edited 1 day ago)

That does NOT sound like a good idea.

We've turned our development model into a well-oiled engineering marvel,

Exactly, and I'm pretty sure one of the reasons is that it's remained on C, and NOT switched to C++, as has been often suggested.
The second they make it a mixed code base, that's the same second quality will deteriorate. Mixed code base is a recipe for disaster.

Edit:

Torvalds eventually responded by defending the Linux kernel development process and scolding Martin for grandstanding on social media about the issue. Martin later quit as a Linux maintainer and resigned from the Asahi Linux project.

Seems like Linus isn't onboard with this.

But I guess all the downvoters know better?

opening for a mixed code base is a recipe for disaster.

Greg Kroah-Hartman:

Yes, mixed language codebases are rough, and hard to maintain, but we are kernel developers, dammit.

That's special pleading, that lacks basis in reality. Still he admits it's rough to mix codebases.

I'm not claiming Rust wouldn't be brilliant in some situations, but the detraction of a mixed codebase is worse than the benefit.

[-] sugar_in_your_tea@sh.itjust.works 4 points 14 hours ago

It's not like Linux compiles down to one binary or anything, most of it is linked together over a pre-determined API. Anything that can satisfy that API (and ABI) can drop in. There are some "magic" bindings, but they still conform to that API.

Read the rest of Greg KH's thread, here's the last half of that paragraph:

Adding another language really shouldn't be a problem, we've handled much worse things in the past and we shouldn't give up now on wanting to ensure that our project succeeds for the next 20+ years. We've got to keep pushing forward when confronted with new good ideas, and embrace the people offering to join us in actually doing the work to help make sure that we all succeed together.

And earlier:

Rust also gives us the ability to define our in-kernel apis in ways that make them almost impossible to get wrong when using them. We have way too many difficult/tricky apis that require way too much maintainer review just to "ensure that you got this right" that is a combination of both how our apis have evolved over the years (how many different ways can you use a 'struct cdev' in a safe way?) and how C doesn't allow us to express apis in a way that makes them easier/safer to use. Forcing us maintainers of these apis to rethink them is a GOOD thing, as it is causing us to clean them up for EVERYONE, C users included already, making Linux better overall.

Those are solid arguments. As long as the APIs are well designed and documented, a mixed codebase is fine, and you get most of the benefits of Rust where it's used.

[-] WalnutLum@lemmy.ml 6 points 22 hours ago

Seems like Linus isn't onboard with this.

To the contrary:

https://lemmy.ml/post/26272942

[-] farcaster@lemmy.world 42 points 1 day ago

Moving from C to C++ would also not solve any real problem. C++ of course adds OOP which I think can be nice (not everyone agrees with this!) but it also adds an insane amount of language complexity and instability. Mentally reasoning about C code is hard, reasoning about C++ code is nearly impossible.

Rust however brings a novel solution to classes of problems like ownership and mutability with the borrow checker. It's now accepted to be a great tool for writing high performance code while preventing a substantial amount of common, but often subtle, bugs from slipping through. It's not arbitrarily the first non-C code to be accepted in the kernel. And it's used in other operating systems like Android and Windows already.

[-] sugar_in_your_tea@sh.itjust.works 17 points 1 day ago* (last edited 19 hours ago)

In general, for me, Rust > C > C++.

I've heard people say that C is like a loaded and cocked revolver, and if you're not careful, you could blow your foot off, whereas C++ is like a loaded and cocked sawed-off shotgun, and if you're not careful, you could blow your leg off.

[-] FarceOfWill@infosec.pub 4 points 1 day ago* (last edited 1 day ago)

C++ is a semi automatic shotgun with 200 barrels pointing in all directions.

[-] gedhrel@lemmy.world 3 points 20 hours ago

Whilst it's gotten a lot better in the -17 and -20 iterations, the fact that there was recently a doorstop book published solely on the subject of C++ initialisation semantics is pretty telling.

I really like what Herb Sutter's doing around cppfront; I still wouldn't use C++ unless I absolutely had to.

[-] brucethemoose@lemmy.world 14 points 1 day ago

Mostly this ^.

There's just not really demand for C++ in the kernel; that's not the case with Rust.

[-] mesamunefire@lemmy.world 13 points 1 day ago* (last edited 1 day ago)

I think rust would also bring in more developers. So more changes would eventually make its way into the kernel.

[-] darklamer@lemmy.dbzer0.com 9 points 1 day ago

The second they make it a mixed code base, that's the same second quality will deteriorate.

I envy your confidence!

[-] Buffalox@lemmy.world 1 points 1 day ago

Maybe I'm wrong, but as I read the article, Linus isn't convinced this is a good idea either.
I'm not saying things can never change, but opening for a mixed code base is a recipe for disaster.

[-] gedhrel@lemmy.world 3 points 1 day ago

You're wrong, but it's possible the article gave you that impression. Read the mailing-list thread.

It's particularly worth reading Ted T'so's contribution, which (considering his rude behaviour at the recent con led to a previous round of this nonsense) seems much more positive.

this post was submitted on 21 Feb 2025
215 points (100.0% liked)

Technology

63082 readers
3409 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