The topic of the Rust experiment was just discussed at the annual Maintainers Summit. The consensus among the assembled developers is that Rust in the kernel is no longer experimental — it is now a core part of the kernel and is here to stay. So the “experimental” tag will be coming off. Congratulations are in order for all of the Rust for Linux team.

  • HaraldvonBlauzahn@feddit.orgOP
    link
    fedilink
    arrow-up
    15
    ·
    edit-2
    2 days ago

    Enjoy! I don’t know what you used to seriously program on but I am willing to bet that the ownership paradigm that it enforces is going to feel at least moderately new to you, unless you forced yourself to code that way anyways.

    Thinking about ownership is the right way e.g. for C++ as well, so if one has coded professionally in larger systems, it should not be too alien.

    One still needs to learn life time annotations. So, assuming that you know, for example, C++, it is an a bit larger hurdle than picking up Java or Go, but it is worth the time.

    In many aspects, Rust is far more productive and also more beginner-friendly than C++:

    • far better compiler error messages
    • a superb and easy-to-use packaging system
    • Unicode support
    • support for unit testing right in the language
    • strong support for a side-effect-free or “functional programming” style which is great for testing and tasks like data analysis or parsing
    • better modularization
    • avoids implementation inheritance, and the trait system is a bit different but superb
    • no undefined behavior (in safe Rust) which means nothing less than that the code does what it says - and this is extremely useful in larger projects
    • great support for safe concurrency
    • the language and library frees one to think about interfaces and algorithms which is where the big wins for performance are hidden (and IMO one of the key factors for the astounding success of Python).

    I could go on… but I need to do other stuff

      • HaraldvonBlauzahn@feddit.orgOP
        link
        fedilink
        arrow-up
        7
        ·
        2 days ago

        Generally no. As soon as a class hierarchy becomes moderately complex, implementation inheritance makes code very hard to maintain, because you need to read the whole stack of classes to see what a single change will actually do.

        Rust has another system, traits and trait implementations.

      • pr06lefs@lemmy.ml
        link
        fedilink
        arrow-up
        6
        ·
        edit-2
        2 days ago

        The consensus seems to be that implementation inheritance leads to code that is difficult to understand and difficult to reuse. Its perhaps the main reason C++ is banned from the kernel.

    • TriangleSpecialist@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      2 days ago

      Thanks for the detailed answer. Preaching to the choir.

      The existence of the concept of ownership in languages like C++ is why I threw “moderately” in there. I agree depending on what you take that to mean, it may or may not do some heavy lifting.

      For the rest, I’d divide it into hard facts (compiler messages are absolutely undeniable, in any circumstance) and things that can definitely be true depending on your personal use cases. I’m with you on this: for the vast vast majority of tasks commonly understood as software engineering, memory safety is a concern, and a lot, if not all, of your points, are valid.

      I must humbly insist that it does not fit my needs, in the sense that memory safety is of no concern to me, and that the restrictions that a compiler-enforced approach imposes make me less productive, and, subjectively, also less enjoyable because causing more friction.

      That being said, you may also not consider what I’m currently doing to be software engineering, and that’s totally fine. Then we’d agree entirely.

      EDIT: also, there are very few languages less productive and beginner-friendly than C++ in my opinion. The proverbial bar is in hell. But you are talking to an unreasonable C++ hater.

      • HaraldvonBlauzahn@feddit.orgOP
        link
        fedilink
        arrow-up
        4
        ·
        2 days ago

        EDIT: also, there are very few languages less productive and beginner-friendly than C++ in my opinion.

        I am a professional C++ developer with 20 years of experience and have worked in about eight other languages professionally, while learning and using a dozen more in hobby projects.

        I agree with you here. The only areas where specifics are worse are package management in Python, and maintainability of large SIMULINK models.

        • TriangleSpecialist@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          edit-2
          2 days ago

          That’s the sort of indictment of C++ I like to hear. It’s not just me then. I sometimes feel like I’m taking crazy pills with some colleagues who are super enthusiastic about it still.

          But again, I’m stupid, I know I’m stupid, and C++ has way too many features and convoluted behaviours which are hard for me to remember and reason about. It often feels like it makes me think more about the language problems than the actual problem I’m supposed to work on. It may say more about me than the language, but I do feel validated with comments like this.