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?

  • sugar_in_your_tea
    link
    fedilink
    English
    arrow-up
    25
    arrow-down
    1
    ·
    edit-2
    21 hours ago

    I don’t know about you, but I prefer provably correct code over “just trust me bro.”

    There’s an analogy I like here. A manager at a trucking company was hiring a new driver, and he asked each of them how close they could get to the edge on a mountain pass. The first said, “I can get within a wheel’s width.” The second said, “I can drive on the edge, with part of the tire hanging off.” And the third said, “I stay away from the edge.” The third applicant got the job, because why take the risk?

    That’s how I feel about C/C++. Why use them if Rust can do the job? You get a lot more safety features without sacrificing performance, what’s not to like?

      • sugar_in_your_tea
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        1
        ·
        6 hours ago

        Okay? I know a half dozen languages well, and am pretty productive with a half dozen more. If you’re an experienced software engineer, picking up a new language should be easy. If a language is useful for a given task, I use it. If another language offers benefits I want, I learn it.

        It’s like any other profession, why limit yourself to one tool? If a new tool comes out and does the job better, use it.

        I love C and it’s my first choice for low level work like microcontrollers. However, it’s not great for larger projects, especially ones with significant security concerns, since subtle vulnerabilities in different areas could be combined to create an attack. Rust provides a lot of protection against common attacks without a performance cost, so it’s a good choice.

        • riodoro1@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 hours ago

          I think they know C a little better than just to be „productive” with it. And also a lot of those people are not so young anymore to learn a new language well enough to feel comfortable with writing a kernel in.

          • sugar_in_your_tea
            link
            fedilink
            English
            arrow-up
            2
            ·
            4 hours ago

            As do I. I could jump into a modern C codebase and feel comfortable. I’ve worked on microcontrollers, built servers (UDP, TCP, and HTTP), and worked with cross thread communication. If I know what I want to build, I can achieve it with C. Maybe not as quickly as someone who works with it every day (it has been a while), but within a month I’d be back in shape.

            I feel the same about Python, Go, JavaScript (both on server and FE, either React or straight DOM manipulation), and Rust (I use it for personal projects extensively). When I write C++, it usually turns out like C with vectors and smart pointers, so I’ll add that in as well. Except for Rust, I’ve used all of these in a professional capacity (and I did technically do a couple POCs in Rust). I could list a bunch of other languages I’m less confident in, but could also use professionally if needed without needing to study first.

            I’m not suggesting they go out and do the same, I’m merely suggesting that when an option comes along that solves some serious problems they run into every day, maybe they should try it. Most of the languages I mentioned are useless for kernel development, so it makes no sense for them to bother with them. However, Rust is really interesting because it comes with some very compelling guarantees, and you don’t get many guarantees when it comes to low level development.

            If I told a kernel dev that I had a tool that can identify most if not all memory safety/soundness issues in their C code, they wouldn’t hesitate to try it out. But if I ask them to try out Rust (same guarantees), they’ll refuse. Why? Hubris and stubbornness.

    • WalnutLum@lemmy.ml
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      9 hours ago

      Did somebody say “provably correct”?

      Haskell has entered the chat

    • gravitas_deficiency
      link
      fedilink
      English
      arrow-up
      10
      ·
      18 hours ago

      That’s kind the entirety of my point: if Rust is a tool that can make expressing algorithms safer and less prone to error - and it can, in a logically provable sense - then what the fuck ground do you have to push back on?

      • enumerator4829
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        5 hours ago

        I’m still kind of on the fence about Rust in the kernel. Linux isn’t some random hobby project, there are serious people working for serious companies in the project. Rust has a clear value proposition w.r.t. it’s qualities as a language, but I don’t think it’s as clear on a system level.

        Say I’m working for a large company as a dev, maintaining a subsystem (let’s say a driver). Letting other people (filthy casual hobbyists) mess around with their filthy type safety will eventually spill into my subsystem and cause extra work. I don’t want the extra work, I just want to have my driver working and then go home. And even if I’m okay with the extra work, my boss won’t be. Even the risk of extra costs down the line will be enough for some to shut it down completely.

        There are boring people working for huge corporations with huge stakes in the Linux kernel. I don’t think they see that much value in Rust at the moment, and I think the Rust crowd might need to hire some MBAs if they want to expand their presence in the kernel.

        • gravitas_deficiency
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 hours ago

          Oh, so that’s actually a thing I specifically do not care about.

          I tolerate MBA types at my job because they’re part of an equation that yields a paycheck to me. I don’t believe those MBA types should be in the discussion at this level at all.

          In fact, that sort of insistence on implementation details from product and manager types who can’t ever fucking commit to addressing tech debt issues until the system is falling apart is one of the primary frustrations I have in my career.

          • enumerator4829
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            4 hours ago

            I don’t believe those MBA types should be in the discussion at this level at all.

            That’s the thing. They are in the discussion. It doesn’t matter what we think about it. If touching Rust risks yielding lower profits this quarter, it’s an automatic ”fuck off you filthy hobbyists”. Even having the discussion costs money.

            Rust in the kernel isn’t about technology, it’s about economics and risk management. I’d like to see the discussion move on from ”C bad unsafe rust gud typesaf” to a level where the suggested benefits of Rust are made clear to the people holding the bags of money, preferably presenting some actual monetary benefits. (Oh, and to make things worse, there are thousands of different stakeholders, with different interests, many of which are in conflict. Good luck!)

            So yeah, I get that you don’t care about it. But you probably should.