Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Linux

The Linux Kernel Prepares For Rust 1.77 Upgrade (phoronix.com) 49

An anonymous reader shared this post from Phoronix: With Linux 6.8 the kernel's Rust code was brought up to Rust 1.75 while new patches posted this weekend port the code over to Rust 1.76 and then the upcoming Rust 1.77...

With Rust 1.77 they have now stabilized the single-field "offset_of" feature used by the kernel's Rust code. Rust 1.77 also adds a "--check-cfg" option that the Rust kernel code will likely transition to in the future. This follows the Rust for Linux policy of tracking the upstream Rust version upgrades until there is a minimum version that can be declared where all used features are considered stable.

This discussion has been archived. No new comments can be posted.

The Linux Kernel Prepares For Rust 1.77 Upgrade

Comments Filter:
  • “In this exclusive interview, dive deep into the world of open-source programming as Linux creator Linus Torvalds [youtube.com] shares his thoughts on the Rust programming language. Learn about the potential impact of Rust on the Linux kernel and the future of software development.”
  • by dadaz ( 9614606 )
    I never though Linus could get caught in those Language Du Jour games.
    Someone will have to rip the Rust crud out of the kernel some day.
    Or maybe replace that crud with some other, when the new trendy language will come out (and go, like most of them do).
    • Re:Meh (Score:5, Informative)

      by UnknowingFool ( 672806 ) on Monday February 19, 2024 @10:47AM (#64251402)
      There has never been a mandate by Linus that every bit of Linux kernel code must be rewritten in Rust. All this means is that new drivers can be written in Rust not that they must be written in Rust. New drivers can still be written in C89 if the submitter chooses. Also core parts of the kernel are not yet approved to use Rust. Not sure why people are so gloom and doom about this. Rust is being tested; it it does not work out, people will go back to C.
      • by dadaz ( 9614606 )
        Core kernel code in Rust?!?
        It's already bad enough as it is, to have many millions lines of code written in C (which is time proven and known and used by many), with some random code written in a language used by the 0.001% of the available engineering force.
        Years ago a proposal like this would have gotten a pitchfork treatment on LKML.
        • Years ago a proposal like this would have gotten a pitchfork treatment on LKML.

          And what part of the proposal would have gotten a pitchfork treatment? Every time I see the doom and gloom naysayers on Rust, they almost always misstate the actual proposal and status. New drivers can be written in Rust. That is the proposal. That does not mean Linus will auto-approve every new code that is written in Rust as some people have decried that code quality will go automatically down. That does not mean the entire kernel is being rewritten in Rust as some people have imagined. And this is somew

          • by dadaz ( 9614606 )
            It does matter even if drivers only.
            A bunch of code will go in to support that language, maybe a few drivers will get written, and then when the hype will vanish and a new Lust language will show up, so will the maintainers of the added crud.
            Then we will be left with some unused junk written in a language that TIOBE won't even rate anymore, and someone will have to clean it up (and possibly rewrite some of the code written in it).

            You can quote me on this ...
            • A bunch of code will go in to support that language, maybe a few drivers will get written, and then when the hype will vanish and a new Lust language will show up, so will the maintainers of the added crud.

              1) You have asserted already that the code is crud. All code will be reviewed. 2) You do know that code does not stop working when maintainers leave right? Most code does not change unless there is a reason like bug fixes. 3) Maintainers vanishing is not unique to Rust. It happens right now in Linux with C. 4) This is open source; someone else can maintain code besides the original maintainer. 5)Again, C is not disappearing. If the need arises, the driver can be rewritten in C.

              Then we will be left with some unused junk written in a language that TIOBE won't even rate anymore, and someone will have to clean it up (and possibly rewrite some of the code written in it).

              1) Again, you assert that it i

              • by dadaz ( 9614606 )
                Code does not need to be changed only when there are bugfixes.
                The most frequent changes happen when there are internal code refactoring, and developers really enjoy go fixing dead (or on life support at the least) code.

                Do you even know how Linux works?

                Yeah, a git-blame with my name will likely pop up a few thousands LOC...

                • Code does not need to be changed only when there are bugfixes.

                  Read my statement again. "Most code does not change unless there is a reason like bug fixes." Code should not change unless there is a need. I did not say bug fixes are the ONLY need.

                  The most frequent changes happen when there are internal code refactoring, and developers really enjoy go fixing dead (or on life support at the least) code.

                  Again, code changes ARE reviewed in Linux. If someone is changing code just to change code, those changes are rejected in review. Code that is working is not changed unless there is a need. Not sure how to explain that any clearer to you.

                  Yeah, a git-blame with my name will likely pop up a few thousands LOC...

                  If you have experience, then why are all your comments as if you have never added Linux cod

    • by gweihir ( 88907 )

      My take is he got fed up with these morons and is currently giving the Rust fanatics enough rope to hang themselves. It is a pretty good hint that all Rust can be thrown out of the kernel easily.

      • by jabuzz ( 182671 )

        The fact that it has to be "upgraded" to Rust 1.77 shows that they are busy hanging themselves already. That is the issue with all these fad languages is the constant maintenance cycle on existing code so you can continue to use it. Python being the worst of the worst in this regard.

        • by gweihir ( 88907 )

          Well, you can have stable things (i.e. suitable for production) and you can have stuff that is "new" and "innovative" but entirely unsuitable for production. Takes some real-world experience to understand that though, and many big-ego-small-skill coders lack that.

          As to Python, it depends. If you are a bit more conservative in what you use, the only update you really need is to 3.x. On the other hand, Python is very much not a systems programming language, while Rust pretends to be.

  • by 4wdloop ( 1031398 ) on Monday February 19, 2024 @11:15AM (#64251492)

    Kernel being C makes it very portable, how does Rust introduction affect it? I already faced Rust problems in one of my projects that is using Yokto and attempt to make Rust for it failed on the first try.
    But perhaps this will make Rust environment ported more.

    • Kernel being C makes it very portable, how does Rust introduction affect it? I already faced Rust problems in one of my projects that is using Yokto and attempt to make Rust for it failed on the first try. But perhaps this will make Rust environment ported more.

      The changes allow for Rust to be added for new drivers. So if your target platform does not use the driver that is written in Rust, it is not affected. Also there is no mandate that new drivers must use Rust. New drivers can still be written in C. There could be drivers for one platform written in C but in another written in Rust. It is not very portable but different drivers for different platforms is hardly a new thing in Linux.

    • by Sique ( 173459 )
      The Rust language was ported already on many processor families and platforms [rust-lang.org]. Experiences with bootstrapping it on new platforms does exist, so if you want to add a platform, it might be possible to find people supporting you.
      • Sure, I understand that in the core Rust is also based on C/C++ so wherever C/C++ compiler is ported to it 'may be' portable. But in practice it requires specific version of compiler and libraries which makes it much less portable. This is esp acute for niche custom builds. Granted, eventually it will be as good as C/C++.

    • by gweihir ( 88907 )

      There will not be any important kernel parts in Rust for exactly that reason. Most platforms the kernel runs on do not even have a Rust compiler that can target them.

  • Someone at Microsoft, Apple, or Google must be having a big laugh about this, this morning.
    • And why would they be laughing? Apple's MacOS and iOS is based on FreeBSD. FreeBSD is considering adding Rust [phoronix.com]. But independently Apple could write parts of their OS in Rust if they wanted to do so as they have control over the hardware, compiler, and software they use. Google's Chrome OS is based on Linux and they also could incorporate Rust in that as well as other aspects of their business. As for Microsoft, what is their stake in what Linux does?
    • A Microsoft VP presented how they are rewriting their kernel in Rust https://www.thurrott.com/windo... [thurrott.com] and it has since been deployed in a trial in Windows 11 (win32kbase_rs.sys) https://www.itpro.com/software... [itpro.com]
      Apple is using Rust at low level, opinions are it's possible that it is ni the kernel given Apple has many teams and they can make this choice choice https://news.ycombinator.com/i... [ycombinator.com]

If all else fails, lower your standards.

Working...