Announcement

Collapse
No announcement yet.

Linux VGEM Driver Rewritten In Rust Sent Out For Review

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

  • #11
    Originally posted by Weasel View Post
    Funny, because it's Rust proponents who hate pointers for being unsafe which means that they do not understand them themselves.
    It's not that we don't understand them. It's that we recognize that they're a hole in Rust's ability to make problems local and, thus, much easier to diagnose.

    What's special about UB is that it attacks your ability to find bugs, like a disease that attacks the immune system. Undefined behavior can have arbitrary, non-local and even non-causal effects that undermine the deterministic nature of programs. That's intolerable, and that's why it's so important that safe Rust rules out undefined behavior even if there are still classes of bugs that it doesn't eliminate.

    -- trentj @
    https://users.rust-lang.org/t/newbie-learning-how-to-deal-with-the-borrow-checker/40972/11
    Honestly, after more than 25 years of C (and C++), I’ve become very frustrated with the average C code I seen in the wild. OpenSSL is fairly typical, in a lot of ways. So much C code has buffer overflows, numeric overflows, memory leaks, double frees, undefined behavior, and an an endless number of bugs. There are exceptions—djb’s code is quite good, dovecot seems reasonable, OpenBSD audits aggressively—but when I dive into most C code, I expect problems… I’m tired. I don’t want to rely on programmers practicing constant, flawless vigilance.

    -- emk @ https://www.reddit.com/r/rust/commen...not_a/ds0u68p/

    Comment


    • #12
      Originally posted by Weasel View Post
      Funny, because it's Rust proponents who hate pointers for being unsafe which means that they do not understand them themselves.
      Still waiting for you to show us that amazing non-trivial program that handles 100% of memory allocation errors that you promised us.
      You're not gonna accomplish it by trolling forums.

      Comment


      • #13
        Originally posted by Weasel View Post
        Funny, because it's Rust proponents who hate pointers for being unsafe which means that they do not understand them themselves.
        The problem is that the vast majority of developers are substandard. If I write some C code, and a unit test suite with 100% coverage, and I run it through valgrind at every commit/merge/release/whatever, that would be pretty safe, right? So we have languages like Java, Rust, etc... that emphasize "safety", when under the hood, at some point, it's still all pointers, the "safety" is that the developer that wrote the Java, Rust, etc... toolchains are supposedly much smarter than the people using their language, and hopefully didn't make any mistakes. But when those supposed genius core language developers make a mistake in their "safety" code, it's 100x harder to debug than in C code compiled with stable, mature compiler.

        Comment


        • #14
          Originally posted by Barnacle View Post
          But when those supposed genius core language developers make a mistake in their "safety" code, it's 100x harder to debug than in C code compiled with stable, mature compiler.
          But it only has to be fixed in one place, rather than countless places. Even if it is 100 times harder, it only takes one bug averted in 100 products, or ten bugs averted in ten products to break even.

          (Remember that Rust developers make use of regression testing to a paranoid degree. If they fix something, they're going to make damn sure it stays fixed.)
          Last edited by ssokolow; 22 March 2023, 07:17 PM.

          Comment


          • #15
            Originally posted by Barnacle View Post

            The problem is that the vast majority of developers are substandard. If I write some C code, and a unit test suite with 100% coverage, and I run it through valgrind at every commit/merge/release/whatever, that would be pretty safe, right? So we have languages like Java, Rust, etc... that emphasize "safety", when under the hood, at some point, it's still all pointers, the "safety" is that the developer that wrote the Java, Rust, etc... toolchains are supposedly much smarter than the people using their language, and hopefully didn't make any mistakes. But when those supposed genius core language developers make a mistake in their "safety" code, it's 100x harder to debug than in C code compiled with stable, mature compiler.
            I am so confused by this.
            What are you trying to say? That the compiler might randomly decide to generate invalid pointers or something?
            I don't even know what kind of logical fallacy this is, it's more like incoherent rambling.

            Also, Java isn't "safe". You're confused by the erroneous definition (that even some Rust programmers make) that a simple lack of direct pointer manipulation is "safe". Rust is safe because it forces you to check every part of your program. Who owns what, who can modify or manipulate what, making sure you check every path and leave nothing untouched. It's why Rust is not only easier to write but also read, you're skipping the entire runtime debugging part and you can read exactly what path of execution the code will go down.

            Please, learn a language before you criticize it. You remind me of Johnathan Blow (my idol and a compsci genius) trying to critique Rust by watching a gamedev talk about it and trying to point out "gotchas" which he got every one incorrect because he didn't know how the ownership system worked (he thought using a mutex was "cheating your way out of it" when the mutex *always* owns what it holds, it just lets you borrow it)

            Comment


            • #16
              Originally posted by BreachScrambler View Post

              Are you claiming C++ is simpler than Rust??
              How is it that nowadays people always infer the opposite of what somebody says/writes?

              Did you even read the first paragraph I wrote? There you find the important stuff I wanted to say.

              Comment


              • #17
                Originally posted by jacob View Post

                I welcome Rust precisely because I absolutely despise C++.
                You're honest. That's why I value your comments. Even if I don't share your opinion.

                Comment


                • #18
                  This Rust VGEM driver in its current form is roughly 500 lines of new code.
                  Michael , any idea how big is the one it replaces? This would be very valuable information, especially for Rust advocates, but also the rest of us.

                  Comment


                  • #19
                    Originally posted by lowflyer View Post

                    How is it that nowadays people always infer the opposite of what somebody says/writes?
                    If you mean the opposite and your answer to my question is no, then why are you being surprised that people who dislike C++ for its complexity would find Rust to be better?

                    Originally posted by lowflyer View Post

                    Did you even read the first paragraph I wrote? There you find the important stuff I wanted to say.


                    I did. It only turned confusing when you questioned people's language preference, C++ vs Rust, given that the first is unanimously regarded as one of the most complex language ever.

                    Comment


                    • #20
                      Originally posted by Ironmask View Post
                      Still waiting for you to show us that amazing non-trivial program that handles 100% of memory allocation errors that you promised us.
                      You're not gonna accomplish it by trolling forums.
                      I already gave you plenty of examples. How do you know I didn't write (some) of it? Unlike you.

                      Still waiting fort you to admit defeat you lying sack of shit. You owe me the bet.

                      Comment

                      Working...
                      X