Announcement

Collapse
No announcement yet.

Updated Rust Code For Linux Kernel Patches Posted

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Updated Rust Code For Linux Kernel Patches Posted

    Phoronix: Updated Rust Code For Linux Kernel Patches Posted

    In 2022 we will very likely see the experimental Rust programming language support within the Linux kernel mainlined. Sent out this morning were the updated patches introducing the initial support and infrastructure around handling of Rust within the kernel...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    When did "we devs don't wanna have to learn another language" become "potentially lowering the barrier to contributing to the kernel"?

    Comment


    • #3
      Originally posted by Developer12 View Post
      When did "we devs don't wanna have to learn another language" become "potentially lowering the barrier to contributing to the kernel"?
      There are many factors that can contribute to a lower entry barrier. And some of them are listed on the PR itself


      - Maintainers are more confident in refactoring and accepting patches for modules thanks to the safe subset of Rust.

      - New drivers and modules become easier to write, thanks to abstractions that are easier to reason about, based on modern language features, as well as backed by detailed documentation.

      - More people get involved overall in developing the kernel thanks to the usage of a modern language.

      Comment


      • #4
        I could indeed imagine that I eventually start contributing to the linux kernel due to these changes.
        It took me less than one year from starting to learn Rust till having my first rustc contributions.
        I've used C++ for more than 5 years, but never would have even thought about contributing something to a serious C++ project.
        The kernel C might be a little bit easier to understand than a full grown C++ codebase, but I still would never consider touching any of that c code.

        Comment


        • #5
          Originally posted by amxfonseca View Post
          There are many factors that can contribute to a lower entry barrier. And some of them are listed on the PR itself
          But there is still the problem of needing C developers going forwards to maintain core parts and nothing of these changes so far will make that code more readable to developers who are skilled in rust but not C. Time will tell if rust long term for the linux kernel is a benefit or harm.

          Really I would have liked to see sparse the static checking program of the Linux kernel over C parts gain more and more ways to checking for faults in the Linux kernel version of C that rust forbids. Yes this would lead to more rust like annotation in the C code so making it simple for rust developer to understand the C code.

          Comment


          • #6
            Originally posted by ZuseZ4 View Post
            I could indeed imagine that I eventually start contributing to the linux kernel due to these changes.
            It took me less than one year from starting to learn Rust till having my first rustc contributions.
            I've used C++ for more than 5 years, but never would have even thought about contributing something to a serious C++ project.
            The kernel C might be a little bit easier to understand than a full grown C++ codebase, but I still would never consider touching any of that c code.
            There's no such thing as kernel C. It's just C and nothing remotely close to C++. The real challenge with kernel development is learning the ins and outs of the kernel itself which you will do regardless of C or Rust.

            Comment


            • #7
              Originally posted by Developer12 View Post
              When did "we devs don't wanna have to learn another language"
              I have never worked with any good developer who is not able to learn another language, and more than willing to do so if it improves their workflow(s) or efficiency. I do admit I have worked with a few Wallys(*) who find ways to put energy into doing nothing at all, but they would not be considered among the good.

              become "potentially lowering the barrier to contributing to the kernel"?
              With the C language offering of multiple ways to injure yourself and others, needing to be nearly perfect every time is a high bar to becoming a kernel contributor. High enough that many will not even take those first baby steps, knowing not only will they fail (everyone falls down with their first steps), but will often not get the assistance needed to try again. And while there are those who espouse every developer should be perfect each and every time, such perfection is not available in the real world. Rust introduces language protections against entire classes of errors that otherwise might not be identified even by careful review by one of these alleged perfect reviewers. The result is not only are training wheels available to new contributors, but reviewers do not have to be quite as perfect each and every time IRT language construct opportunities, but can focus on higher level issues in the code. That would appear to be a win for almost everyone.





              (*) Dilbert reference

              Comment


              • #8
                Originally posted by xerom62 View Post

                There's no such thing as kernel C. It's just C and nothing remotely close to C++. The real challenge with kernel development is learning the ins and outs of the kernel itself which you will do regardless of C or Rust.
                I probably not speak for another, but I sort of read it more as the (standard) C code that makes up the kernel. Anyway, I don't know C or C++ or Rust for that matter, so what do I know???

                Comment


                • #9
                  There are some problems with the Rust language:
                  • Long compile times / slow build
                  • The resulting binary produced is large
                  • You cannot declare async functions inside a trait
                  • Libraries built using a async runtime are incompatible with other libraries built using a different async runtime

                  Comment


                  • #10
                    I don't know why the hurry to implement Rust if GCC-RS is not completed yet.

                    Comment

                    Working...
                    X