Linux 6.13 Hits A "Tipping Point" With More Rust Drivers Expected Soon

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • darkonix
    Senior Member
    • Sep 2021
    • 395

    #11
    Originally posted by Volta View Post

    Yes, that will be fun when something breaks. This rust thing is against Linux principles, but since Linus and Hartman became clowns it's not surprising. In good kernel practices there's stated typedefs should be avoided. I bet rust abstractions are much worse than just typedefs in C. Oh, and this rust thing is built upon unstable API. When Hartman wasn't clown:

    Thanks for sharing the link with the solution to this issue:
    "If your driver is in the tree, and a kernel interface changes, it will be fixed up by the person who did the kernel change in the first place. This ensures that your driver is always buildable, and works over time, with very little effort on your part."

    Easy enough. You break it, you fix it.

    Comment

    • ssokolow
      Senior Member
      • Nov 2013
      • 5123

      #12
      Originally posted by amity View Post

      I've tried getting into it but the syntax is just godawful to me, and if I can't stand to look at it, I cannot code with it. As a C++ developer I am very much looking forward to Swift gaining popularity instead.
      How so? It's literally C++ syntax with bits of Ocaml (rustc was originally written in Ocaml) slotted in wherever C++ didn't have a syntax for what they needed or C++'s syntax was technically inferior for some reason. (And by "technically inferior", I mean things like the Lexer hack and the Most vexing parse.)

      Comment

      • dremon_nl
        Senior Member
        • Nov 2015
        • 123

        #13
        Originally posted by amity View Post

        I've tried getting into it but the syntax is just godawful to me, and if I can't stand to look at it, I cannot code with it. As a C++ developer I am very much looking forward to Swift gaining popularity instead.
        I would say it's quite the opposite: Rust has clean non-ambiguous syntax which is easy to read and understand, while C++ and templates in particular is a total mess which even compiler struggles with.

        Comment

        • jacob
          Senior Member
          • Jul 2010
          • 2972

          #14
          Originally posted by ssokolow View Post

          How so? It's literally C++ syntax with bits of Ocaml (rustc was originally written in Ocaml) slotted in wherever C++ didn't have a syntax for what they needed or C++'s syntax was technically inferior for some reason. (And by "technically inferior", I mean things like the Lexer hack and the Most vexing parse.)
          One of the main points was IIRC that they wanted to be able to use a simple recursive descent parser (which doesn't work for C++ and not even for C). There's a school of thought, particularly among the Haskell people, that a language should be nice and easy for humans and too bad if that makes it hard for the compiler. I basically agree with that. Still I think it's fair to say that Rust owes a big part of its success to its excellent tooling, so the decision to have a machine friendly syntax has worked out well for them.

          Comment

          • ssokolow
            Senior Member
            • Nov 2013
            • 5123

            #15
            Originally posted by jacob View Post

            One of the main points was IIRC that they wanted to be able to use a simple recursive descent parser (which doesn't work for C++ and not even for C). There's a school of thought, particularly among the Haskell people, that a language should be nice and easy for humans and too bad if that makes it hard for the compiler. I basically agree with that. Still I think it's fair to say that Rust owes a big part of its success to its excellent tooling, so the decision to have a machine friendly syntax has worked out well for them.
            Plus, the main machine-friendly decisions that deviate from C++ are the presence of let to avoid the need for the lexer hack and most vexing parse and the use of the EXPR as TYPE operator for typecasting to avoid a side-channel for the most vexing parse.

            The postfix types are more because, if type inference is going to be your encouraged default, you might as well have let (foo, bar, baz) = ... instead of something like (auto foo, auto bar, auto baz) = ...

            Everything else that comes to mind is "C++ doesn't have this, so we'll borrow the Ocaml syntax".
            Last edited by ssokolow; 30 November 2024, 05:07 PM.

            Comment

            • Weasel
              Senior Member
              • Feb 2017
              • 4518

              #16
              Originally posted by darkonix View Post
              Easy enough. You break it, you fix it.
              That only applies to C.

              If you break Rust code, they're expected to fix it. Which is good so you don't get infected and have your brain start rusting.

              Comment

              • anarki2
                Senior Member
                • Mar 2010
                • 861

                #17
                Originally posted by Weasel View Post
                That only applies to C.

                If you break Rust code, they're expected to fix it. Which is good so you don't get infected and have your brain start rusting.
                It must be very sad for you to be rooting for something to fail being the only motivation in your life.

                Comment

                • CommunityMember
                  Senior Member
                  • Oct 2019
                  • 1381

                  #18
                  Originally posted by oleid View Post
                  Oh look, Statler and Waldorf are already here.
                  They are rooting for no nvidia GPU driver support in the kernel, and no Apple M-series GPU driver support in the kernel (in both cases written in rust by the current people doing the actual work).

                  I am sure they are stepping up and putting their money (and time) where their mouth is, and writing C (only) drivers for both, and all we need to do is wait just a little bit longer for their excellent pull requests. I am sure their kernel fork will be awesome.

                  Comment

                  • rafanelli
                    Phoronix Member
                    • Apr 2022
                    • 60

                    #19
                    I wonder what parts of the kernel can be ported from C to Rust with relatively little human involvement in a couple of years. Transpilers. LLMs. They all keep getting better, and currently there's even some legislation that mandates/suggests mem-safe langs need be used.

                    Comment

                    • darkonix
                      Senior Member
                      • Sep 2021
                      • 395

                      #20
                      Originally posted by kpedersen View Post

                      Indeed. When it all falls through and everything touching Rust needs to be ripped out again, even today's GNU Libre kernel will look featureful in comparison.
                      Not a real issue for most kernel developers it seems:

                      Thomas Gleixner said that the Rust developers are careful about documenting their code, and he is not frightened by the prospect of refactoring it. If he does not understand something, he will simply send an email to the developer, just as he does with C code. Torvalds added that Rust has a lot to offer, and the kernel should try to take advantage of it. Kroah-Hartman said that it could eliminate entire classes of bugs in the kernel.
                      Last edited by darkonix; 30 November 2024, 10:15 PM.

                      Comment

                      Working...
                      X