But for new code / drivers, writing them in rust where these types of bugs just can’t happen (or happen much much less) is a win for all of us, why wouldn’t we do this? C++ isn’t going to give us any of that any decade soon, and the C++ language committee issues seem to be pointing out that everyone better be abandoning that language as soon as possible if they wish to have any codebase that can be maintained for any length of time.

Rust also gives us the ability to define our in-kernel apis in ways that make them almost impossible to get wrong when using them. We have way too many difficult/tricky apis that require way too much maintainer review just to “ensure that you got this right” that is a combination of both how our apis have evolved over the years (how many different ways can you use a ‘struct cdev’ in a safe way?) and how C doesn’t allow us to express apis in a way that makes them easier/safer to use. Forcing us maintainers of these apis to rethink them is a GOOD thing, as it is causing us to clean them up for EVERYONE, C users included already, making Linux better overall.

And yes, the Rust bindings look like magic to me in places, someone with very little Rust experience, but I’m willing to learn and work with the developers who have stepped up to help out here. To not want to learn and change based on new evidence (see my point about reading every kernel bug we have.)

Rust isn’t a “silver bullet” that will solve all of our problems, but it sure will help in a huge number of places, so for new stuff going forward, why wouldn’t we want that?

  • Zangoose@lemmy.world
    link
    fedilink
    arrow-up
    26
    ·
    2 days ago

    revamp Rust to produce lightweight binaries, have a stable compiler and for it to be way quicker in compilation

    It really isn’t that simple though. Rust’s compiler isn’t stable because the language itself is still being improved. This type of thing will only improve as adoption increases and real-world problems get ironed out. You can’t just throw money and devs at it and expect the problem to be solved.

    It’s also not like the developers don’t care about compile time, but the nature of the language (strict compiler checks which catch things before runtime) will inherently lead to something slower that other languages’ compilers. There are probably still improvements they can make, but it’s not as simple as just deciding to rewrite/revamp it and expecting massive speedups.

    • HiddenLayer555@lemmy.ml
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      5 hours ago

      Every time Rust takes forever to compile something, I picture in my mind it checking every possible edge case and buffer vulrnability I didn’t check and suddenly I’m a lot more okay with how long it takes.

    • m4m4m4m4@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      20 hours ago

      You can’t just throw money and devs at it and expect the problem to be solved.

      Then nobody will throw money at any project at all, because everything eventually will be solved by “magick”.

      Destinating more resources to that quickens and makes better that process, though, incentivating people to work on it and test it.

      • Zangoose@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        8 hours ago

        It’s not magic, it’s adoption rates. I’m not saying the money or resources are useless, but as it is right now, I think more people would benefit from actually trying to use rust in more large-scale projects (like R4L, windows, android, redox, servo, etc.) and using that experience to inform actual language development. I don’t think it makes sense to do a full revamp of the compiler until projects like those are actually proven. In the meantime it makes more sense to allocate funding/dev resources to those projects (or at least the open source ones)

      • Senal@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 hours ago

        That’s one of the reasons why you get delayed or cancelled, over-budget projects that go nowhere. ( another big one is corruption and general financial shenanigans ).

        if you throw a lot of money at a problem/project that doesn’t have reasonable management and competent understanding of where that money could work efficiently then you’re asking for trouble.

        Destinating more resources to that quickens and makes better that process, though, incentivating people to work on it and test it.

        That is charmingly naive, in my experience.

        I’m not saying more money wouldn’t help, I’m saying throwing money at it isn’t generally a stand-alone solution, which is what i think the person you were replying to was trying to say.