Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Tuesday September 20 2022, @05:04AM   Printer-friendly

News and Advice on the World's Latest Innovations:

The Rust in Linux debate is over. The implementation has begun. In an email conversation, Linux's creator Linus Torvalds, told me, "Unless something odd happens, it [Rust] will make it into 6.1."

The Rust programming language entering the Linux kernel has been coming for some time. At the 2020 Linux Plumbers Conference, developers started considering using the Rust language for new Linux inline code. Google, which supports Rust for developing Android -- itself a Linux distro -- began pushing for Rust in the Linux kernel in April 2021.

As Wedson Almeida Filho of Google's Android Team said at the time, "We feel that Rust is now ready to join C as a practical language for implementing the kernel. It can help us reduce the number of potential bugs and security vulnerabilities in privileged code while playing nicely with the core kernel and preserving its performance characteristics."

It took a while to convince the top Linux kernel developers of this. There were concerns about non-standard Rust extensions being needed to get it to work in Linux. For instance, with the new Rust Linux NVMe driver, over 70 extensions needed to be made to Rust to get it working. But, Torvalds had told me in an earlier interview, "We've been using exceptions to standard C for decades."

This was still an issue at the invitation-only Linux Kernel Maintainers Summit. But, in the end, it was decided that Rust is well enough supported in the Clang -- the C language family compiler front end -- to move forward. Besides, as Torvalds had said earlier, "Clang does work, so merging Rust would probably help and not hurt the kernel."

[...] Now, Torvalds warns in this first release, Rust will "just have the core infrastructure (i.e. no serious use case yet)." But, still, this is a major first step for Rust and Linux.


Original Submission

 
This discussion was created by janrinok (52) for logged-in users only, but now has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 5, Informative) by RamiK on Tuesday September 20 2022, @07:44AM (5 children)

    by RamiK (1813) on Tuesday September 20 2022, @07:44AM (#1272521)

    Asked about a suggestion by a commenter on the Linux Weekly News website, who said, during a discussion on the Google post, "The solution here is simple: just use C++ instead of Rust", Torvalds could not restrain himself from chortling.

    "LOL," was his response. "C++ solves _none_ of the C issues, and only makes things worse. It really is a crap language.

    "For people who don't like C, go to a language that actually offers you something worthwhile. Like languages with memory safety and [which] can avoid some of the dangers of C, or languages that have internal GC [garbage collection] support and make memory management easier.

    "C++ solves all the wrong problems, and anybody who says 'rewrite the kernel in C++' is too ignorant to even know that."

    ( https://itwire.com/business-it-news/open-source/rust-support-in-linux-may-be-possible-by-5-14-release-torvalds.html [itwire.com] )

    --
    compiling...
    Starting Score:    1  point
    Moderation   +3  
       Informative=3, Total=3
    Extra 'Informative' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   5  
  • (Score: 3, Insightful) by PiMuNu on Tuesday September 20 2022, @05:23PM (4 children)

    by PiMuNu (3823) on Tuesday September 20 2022, @05:23PM (#1272589)

    I don't know if I agree with all that stuff - but as someone who has coded in C++ for 20 odd years I think it is a bloated piece of ****.

    • (Score: 2) by RamiK on Tuesday September 20 2022, @06:58PM (3 children)

      by RamiK (1813) on Tuesday September 20 2022, @06:58PM (#1272616)

      I don't know if I agree with all that stuff - but as someone who has coded in C++ for 20 odd years I think it is a bloated piece of ****.

      Bear in mind Torvalds wrote Subsurface in C++ and continues to contribute and use it so he's just as much of a "there's a C++ library for that" victim as the rest of us.

      --
      compiling...
      • (Score: 3, Informative) by PiMuNu on Wednesday September 21 2022, @11:47AM (2 children)

        by PiMuNu (3823) on Wednesday September 21 2022, @11:47AM (#1272732)

        It's not the libraries, it's the sheer volume of keywords and cr*p in the core language. Just look at any style guide for a list of anti-features that are not to be used.

        * Implicitly defined initialisers
        * Different syntax for constructors with no arguments and constructors with arguments? WTF?
        * Template syntax altogether is a nightmare
        * and so on

        • (Score: 2) by RamiK on Wednesday September 21 2022, @01:02PM (1 child)

          by RamiK (1813) on Wednesday September 21 2022, @01:02PM (#1272745)

          I meant that despite everything about C++ itself being crap, we're all victims of our dependence on existing C++ libraries and end up using it or stuff made in C++ regardless. e.g. the browser I'm typing in right now...

          --
          compiling...
          • (Score: 2) by PiMuNu on Wednesday September 21 2022, @04:53PM

            by PiMuNu (3823) on Wednesday September 21 2022, @04:53PM (#1272807)

            Understood - and agreed...