Announcement

Collapse
No announcement yet.

LPC 2022: Rust Linux Drivers Capable Of Achieving Performance Comparable To C Code

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

  • #41
    Originally posted by cardich View Post
    Rust is more of a "vanity project" than a concept.
    Says the local vanity expert.

    Comment


    • #42
      Originally posted by jacob View Post

      Actually significant parts of the Linux kernel do get rewritten every now and then. For now Rust will be used for "leaf" modules only, so not in the core kernel, but if Rust is successful there, then it may change. Of course for various reasons the rewritters may not necessarily always use Rust even when it's available, but I wouldn't be surprised if by the end of the decade we have some Rust code in the process scheduler or memory manager.
      Certainly it could end up in device drivers... especially those that deal with nasty unknown external input like graphics drivers.

      Comment


      • #43
        Originally posted by cb88 View Post

        Certainly it could end up in device drivers... especially those that deal with nasty unknown external input like graphics drivers.
        Device drivers are the first use case for it

        Comment


        • #44
          Originally posted by cardich View Post
          Hooray! Rust has got it made in reinventing the wheel.
          Hooray, you have no clue what you are talking about...

          Comment


          • #45
            Originally posted by swoorup View Post

            Hooray, you have no clue what you are talking about...
            nah it's pretty accurate, I already replied to it, but it is indeed re-inventing the wheel, we have finally upgraded to rubber tires from the old wodden cart wheels we were using before

            Comment


            • #46
              Originally posted by Quackdoc View Post

              nah it's pretty accurate, I already replied to it, but it is indeed re-inventing the wheel, we have finally upgraded to rubber tires from the old wodden cart wheels we were using before
              lol good analogy.

              Comment


              • #47
                Originally posted by PAUL007 View Post
                Is modern Cpp bad for memory handling ?
                No - in fact, it's provably as "perfect" / correct as Rust is.

                That's not the point though, despite all the shouting you hear about it. The difference, and sole benefit of Rust, is that if (i.e. realistically "when", for any team of more than a handful of people) you screw up the Rust code will fail to compile; whereas the C++ code will fail at runtime. One of those outcomes is significantly more desirable than the other.

                Comment


                • #48
                  Originally posted by arQon View Post
                  No - in fact, it's provably as "perfect" / correct as Rust is.

                  That's not the point though, despite all the shouting you hear about it. The difference, and sole benefit of Rust, is that if (i.e. realistically "when", for any team of more than a handful of people) you screw up the Rust code will fail to compile; whereas the C++ code will fail at runtime. One of those outcomes is significantly more desirable than the other.
                  There is more to the difference than that. Static program analysis there exists Coverity and others like for C++ that do more than C and C++ compilers do these days.

                  Lot of the issues rust prevent using Coverity and other full program C++ tools will prevent as well. Then you notice something rust prevents the problem when you build a single object file but with C++ and C with extra notation cannot instead requires complete program source.

                  Note I said extra notation item that do extra notation is items like sparse with the Linux kernel. Rust language in fact more strict language on what has to be include so the information is there that issues can be solved in a single source file making a single object.

                  C++ code failing at runtime is not 100 percent correct. C++ code failing when complete program is built is the true answer. Remember full program being built this could be runtime or this could be complete program static analysis. Being at the complete program point is not ideal for productivity. Like you have modified one source file ideal is just remake that object and make the program for testing. C and C++ having to run complete program analysis or some form to find problems is really not ideal.

                  Over the years C and C++ compilers have been adding more and more Static program analysis but there is still the problem that the C and C++ language does not have the data to lot of the static program analysis without processing the complete program. Remember this is a bigger nightmare when people are using closed third party libraries because the C/C++ headers to standard don't in fact declare enough information to perform Static program analysis.

                  Rust fails when you make object for 100 percent of rust detectable faults.
                  C and C++ attempts with modern compilers to fail when you make object with items like address sanitizer but then you notice its missed stuff that it magically detects when you use link time optimization and yes link time optimization is running address sanitizer complete program where it has more information and has to perform lot of process to work out the information. Remember the faults rust prevents includes address sanitizer detected faults when you make the object.

                  The reality here C and C++ in theory are both fixable to be rust quality language. But the fix would be a code breaking change. As in compilers would have to refuse to build different C and C++ files until extra information is added describing how different items should behave.

                  Comment


                  • #49
                    Originally posted by arQon View Post

                    if you screw up the Rust code will fail to compile; whereas the C++ code will fail at runtime
                    Why don't you give us an example (if any) instead of concocting unfathomable speculations?

                    Comment


                    • #50
                      Originally posted by cardich View Post
                      Why don't you give us an example (if any) instead of concocting unfathomable speculations?
                      erm... because it's reality, and there's no "speculation" at all to that statement? Not sure what your question / point is supposed to be.

                      Comment

                      Working...
                      X