Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming Linux

What Do Linux Kernel Developers Think of Rust? (thenewstack.io) 34

Keynotes at this year's FOSDEM included free AI models and systemd, reports Heise.de — and also a progress report from Miguel Ojeda, supervisor of the Rust integration in the Linux kernel. Only eight people remain in the core team around Rust for Linux... Miguel Ojeda therefore launched a survey among kernel developers, including those outside the Rust community, and presented some of the more important voices in his FOSDEM talk. The overall mood towards Rust remains favorable, especially as Linus Torvalds and Greg Kroah-Hartman are convinced of the necessity of Rust integration. This is less about rapid progress and more about finding new talent for kernel development in the future.
The reaction was mostly positive, judging by Ojeda's slides:

- "2025 will be the year of Rust GPU drivers..." — Daniel Almedia

- "I think the introduction of Rust in the kernel is one of the most exciting development experiments we've seen in a long time." — Andrea Righi

- "[T]he project faces unique challenges. Rust's biggest weakness, as a language, is that relatively few people speak it. Indeed, Rust is not a language for beginners, and systems-level development complicates things even more. That said, the Linux kernel project has historically attracted developers who love challenging software — if there's an open source group willing to put the extra effort for a better OS, it's the kernel devs." — Carlos Bilbao

- "I played a little with [Rust] in user space, and I just absolutely hate the cargo concept... I hate having to pull down other code that I do not trust. At least with shared libraries, I can trust a third party to have done the build and all that... [While Rust should continue to grow in the kernel], if a subset of C becomes as safe as Rust, it may make Rust obsolete..." Steven Rostedt

Rostedt wasn't sure if Rust would attract more kernel contributors, but did venture this opinion. "I feel Rust is more of a language that younger developers want to learn, and C is their dad's language."

But still "contention exists within the kernel development community between those pro-Rust and -C camps," argues The New Stack, citing the latest remarks from kernel maintainer Christoph Hellwig (who had earlier likened the mixing of Rust and C to cancer). Three days later Hellwig reiterated his position again on the Linux kernel mailing list: "Every additional bit that another language creeps in drastically reduces the maintainability of the kernel as an integrated project. The only reason Linux managed to survive so long is by not having internal boundaries, and adding another language completely breaks this. You might not like my answer, but I will do everything I can do to stop this. This is NOT because I hate Rust. While not my favourite language it's definitively one of the best new ones and I encourage people to use it for new projects where it fits. I do not want it anywhere near a huge C code base that I need to maintain."
But the article also notes that Google "has been a staunch supporter of adding Rust to the kernel for Linux running in its Android phones." The use of Rust in the kernel is seen as a way to avoid memory vulnerabilities associated with C and C++ code and to add more stability to the Android OS. "Google's wanting to replace C code with Rust represents a small piece of the kernel but it would have a huge impact since we are talking about billions of phones," Ojeda told me after his talk.

In addition to Google, Rust adoption and enthusiasm for it is increasing as Rust gets more architectural support and as "maintainers become more comfortable with it," Ojeda told me. "Maintainers have already told me that if they could, then they would start writing Rust now," Ojeda said. "If they could drop C, they would do it...."

Amid the controversy, there has been a steady stream of vocal support for Ojeda. Much of his discussion also covered statements given by advocates for Rust in the kernel, ranging from lead developers of the kernel and including Linux creator Linus Torvalds himself to technology leads from Red Hat, Samsung, Google, Microsoft and others.

What Do Linux Kernel Developers Think of Rust?

Comments Filter:
  • by quonset ( 4839537 ) on Sunday February 09, 2025 @12:49PM (#65153741)

    Not sure if the person who posted this works with Linux, or even programming, but this probably sums up the responses [9cache.com].

  • by Tablizer ( 95088 ) on Sunday February 09, 2025 @12:51PM (#65153745) Journal

    ...rather than keep arguing about it. Jeez, enough already.

    • If Google is such a fan, let it finance the project.

    • Re: (Score:3, Insightful)

      by RUs1729 ( 10049396 )
      Hear, hear! Sometimes it looks as though the Rust fans just wanted to get close to Linux in an effort to siphon out some of the latter's fame in their direction. Rust people: since Rust is so much better than C it is your duty to show it with facts: write your own Rust kernel. If you do not, your image as described above will become more and more pervasive with every passing day.
      • by PPH ( 736903 )

        Heck. Just port systemd to Rust as a start.

      • by tlhIngan ( 30335 )

        To be fair, I can see the appeal. Sometimes the kernel needs to do higher level things, and those can be done better in a more appropriate language. The kernel blue screen of death, for example, is something that can be done in C, but things like the QR code really should be done in Rust to be something less potentially bug-ridden.

        And some device drivers are performing very high level functions - which should be pushed to userspace but sometimes might not be, and should incorporate some things to make them

        • The Rust developers are building bindings and safe abstractions to all the things you might need to interact with.

          The rust code is walled off and the kernel can be compiled without Rust. The rust developers are adapting their code as the client C code changes. So, they have done everything you suggest.

          But the addition of any Rust at all to the kernel has inevitable consequences. If you maintain a C API and you change it, then you may break downstream code. And when that happens it has to be fixed. Now, if t

      • There is a kernel written in Rust.

        The Rust in linux developers want to add Rust to linux, though, because it is used extremely widely. If it works and people like to use the Rust bindings, then they are doing exactly what you are asking them to do; show it with facts.

  • If it works it works, regardless of the language. While I'm not exactly kernel dev levels of experienced with programming, I know enough C to easily configure dwm on my machine, and from what I know of it, it's a really nice language and I think it's the best language for the kernel. I admit, however, that it lacks some modern niceties like memory-safety. Overall, I have no problem with Rust in the kernel, though I think it's more important that people learn to write safer C code, though there are limits to
    • > If it works it works, regardless of the language.

      That's a "ship & forget" mentality.
      Linux maintainers need to think a lot further: what happens when a giant refactor/API change happens, who knows both C, rust, and the subsystem well enough to make it happen.
      Rust also makes more things explicit in the API, some which may not be wanted to be explicit.
      I'm not arguing either way here, just talking as small corporate subproject maintainer, thinking about bringing in new technologies, and what consequenc

    • by znrt ( 2424692 )

      I know enough C to easily configure dwm on my machine, and from what I know of it, it's a really nice language and I think it's the best language for the kernel.

      knowing how to edit a header file doesn't qualify as knowledge of a language. i've written quite a bit of professional c/c++ code, i've been programming all sorts of stuff with all sorts of stuff on all sorts of stuff for about 40 years, yet i don't feel qualified at all to emit judgement about c to rust migration in the linux kernel. you'd have to have extensive knowledge about c and rust and a sizable portion of kernel code and its idiosyncrasies. this is a highly specialized topic we'd better leave to th

      • by dfghjk ( 711126 )

        Furthermore, there is nothing more irritating than a statement like "it lacks some modern niceties like memory-safety". This betrays a basic ignorance of issues, yet we always see it in justifications and without any specific supporting arguments.

        Memory safety is not a language feature, even if achieving it may be accomplished with the help of language features.

    • I've done a fair amount of Zig over the last year. I've tinkered with Rust, and I've submitted patches to Linux. I 100% agree that Zig is a more natural fit for kernel work. Zig doesn't have the same memory management rules as Rust, but it's a solid improvement over C. The compiler is good at catching leaks, and bounds are enforced at compile time. The important consideration to me is that Zig runtimes are significantly faster and smaller than Rust. The most important facets of Linux for me are speed, size,

  • Google schmoogle (Score:2, Interesting)

    by Anonymous Coward

    Why are they polluting Linux when their roadmap was to get the Android VM running on Fuchsia?

  • by jrnvk ( 4197967 )

    Linux did fine for decades before Rust, and Rust aficionados need to keep that in mind. C may be old, but it will outlive us all - the jury is still out on Rust having that same distinction.

    • Re:Meh (Score:5, Insightful)

      by dfghjk ( 711126 ) on Sunday February 09, 2025 @02:19PM (#65153867)

      C was created in a time when programmers were better than they are now. "Old" is a compliment to C.

      • I completely agree about C requiring good engineering talent. Those were better days for the IT industry, from my technical perspective. This is a developer community scaling problem for C that Rust does not address, and one reason why so many younger devs prefer JavaScript (ugh) and use it in places where it should not exist.
        With languages like C, you almost have to think about what's going on at the processor level, and of course you have to manage memory by hand instead of counting on garbage collectio
        • Ugh. I meant that I loved C and C++ in the 90s (Borland Turbo C++ had great docs, was a great IDE, and was blazing fast even on ancient hardware - can't imagine how it would perform on a modern terminal!). I loved C# in the 2000s and still like it. Now I like Rust, I just want something like the .NET libraries.

          I'll leave any other typos in that post for posterity.
      • I can't help but wonder what Mel [foldoc.org] would have thought of C. Remember, C won't stop you from doing something dumb because that would stop him from doing something clever.
    • There's 1k of memory corruption CVEs for last year alone. I dare say, using a language like Rust would reduce that somewhat. Assuming the code wasn't all in unsafe blocks. That's another debate, for another day.

  • by BrendaEM ( 871664 ) on Sunday February 09, 2025 @01:41PM (#65153809) Homepage
    A man with a watch knows what time it is. A man with two watches is never sure. --Segal's law
  • Contrary to popular opinion, Rust does not guarantee good code. Just by using Rust, nothing gets better by itself, but it opens the door for better code, which on the other hand a good C programmier also might have achieved using C.
  • Steven Rostedt wrote -
    "I played a little with [Rust] in user space, and I just absolutely hate the cargo concept... I hate having to pull down other code that I do not trust. At least with shared libraries, I can trust a third party to have done the build and all that..."

    The various crate-like things are a fad. The arguably correct way of using shared libraries was reinvented independently by the Gnu libc team and by Solaris, from a first use in Multics. You remember, Unix's papa and Linux's grandpa?

    Gi

    • The problem of course is that shared libraries have no way to export/import Rust's full semantics, they remain C oriented. C++ has the same problem. It's a monumental challenge for linkage of any type, let alone dynamic linkage. Rust and C++ teams are apparently both working to resolve that, and cooperating. Apparently. It's a tough one. I would love to see a resolution, which will hopefully include proper Rust/C++ interoperability.

  • We need more Rusty Russell integration ;)

  • Interesting 9 minute video snippet of Linus speaking with Dirk Hohndel [youtube.com], and giving his thoughts on Rust.

There are worse things in life than death. Have you ever spent an evening with an insurance salesman? -- Woody Allen

Working...