Announcement

Collapse
No announcement yet.

Rust-Written Rustls Now Reportedly Outperforming OpenSSL & BoringSSL

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

  • #81
    Originally posted by Unscript View Post
    Come to think of it, there's also the fact the Rust compiler makes assumptions than the C compiler doesn't, which could be surprising indeed.
    Indeed, aliasing (or the lack of) is the most prominent.
    Thus, bare pointers in rust behave as if you used the keyword restrict in C.

    Naively assuming C memory layout of a type can also ask for trouble in the unsafe-context.
    With the default layout, the compiler will try its best to apply size optimizations for nested enum types. For example an Option<&U> has the same size as &U. Knowing the pointer (which is used under the hood) cannot be NULL, the None variant of the Option will typically get encoded as NULL.
    You can always switch to C layout though, if required.

    Comment


    • #82
      Originally posted by kpedersen View Post

      "Countless" and yet still a tiny fraction compared to Rust projects. Tracking isn't the problem. I am stating that Rust projects tend to to pull in dependencies carelessly. C and C++ projects are much less inclined to do so.
      So, let's see how C++ is doing.
      Let's start with popular C++ projects from this list.
      I skip the first few to make it more fair.
      • OpenCV has >45 direct dependencies.
      • Bitcoin has > 30 direct dependencies.
      • Tesseract has ~12 direct dependencies
      And the worst thing is: you have to install them manually and they are not properly listed - there is no lock file - you have to dig through the CMake code and search for find_package calls.
      I'm making no effort now to check how many indirect dependendencies those projects have.

      Modern CMake projects even start checking out git repositories via cmake.
      So I guess you'll get the worst of both worlds. And don't get me started about conan or vcpkg.
      Last edited by oleid; 26 October 2024, 10:10 AM.

      Comment


      • #83
        Originally posted by Weasel View Post
        By using a C++ library.
        I totally understand that you struggle to learn Rust, it's a bit different from C/C++, but don't hate on it just because you aren't smart/young enough to learn it.

        Comment


        • #84
          Originally posted by mobadboy View Post
          I totally understand that you struggle to learn Rust, it's a bit different from C/C++, but don't hate on it just because you aren't smart/young enough to learn it.
          I totally understand that you struggle to code in C/C++, it's how actual computers work and gives you clean syntax and power and flexibility sane for anyone who understands control flow, but don't hate on them just because you aren't smart enough to get good at it without doing clown mistakes like returning address of a stack variable.

          Sucks to suck.

          Meanwhile the post you quoted is still fact.

          Comment


          • #85
            Originally posted by Weasel View Post
            I totally understand that you struggle to code in C/C++, it's how actual computers work and gives you clean syntax and power and flexibility sane for anyone who understands control flow, but don't hate on them just because you aren't smart enough to get good at it without doing clown mistakes like returning address of a stack variable.

            Sucks to suck.

            Meanwhile the post you quoted is still fact.
            Actually, my C++ is quite good, while my knowledge of the Rust ecosystem is mediocre. I just don't cope and say Rust is bad. I have no problems writing safe, fast code in C++. But Rust makes it a lot easier.

            Comment


            • #86
              Originally posted by mobadboy View Post

              Actually, my C++ is quite good, while my knowledge of the Rust ecosystem is mediocre. I just don't cope and say Rust is bad. I have no problems writing safe, fast code in C++. But Rust makes it a lot easier.
              *nod* Plus, Weasel's message could be mad libs'd into an argument for choosing assembly language over C or C++, so it doesn't really hold much argumentative power.

              Comment


              • #87
                Originally posted by mobadboy View Post
                I have no problems writing safe, fast code in C++.
                You do, because if you didn't, you wouldn't have this opinion about Rust.

                Comment


                • #88
                  Originally posted by ssokolow View Post
                  *nod* Plus, Weasel's message could be mad libs'd into an argument for choosing assembly language over C or C++, so it doesn't really hold much argumentative power.
                  For short functions, sure. Since you can rewrite them when needed. The problem with asm is that it's specific to a given CPU (not just the ISA, but I mean specific uarch optimizations and features) and won't produce better code for most functions (especially the boilerplate stuff).

                  It's not about skill level, but about wasting time rewriting it. But yes if you can't write proper assembly code (not don't, but can't), you're the same low skilled "dev" that uses Rust because he can't write safe C/C++.

                  There are reasons you shouldn't write assembly, such as maintenance or not using new CPU features on old code automatically, but safety is not one of them.


                  tl;dr invalid comparison, sorry.

                  Comment


                  • #89
                    Originally posted by Weasel View Post
                    For short functions, sure. Since you can rewrite them when needed. The problem with asm is that it's specific to a given CPU (not just the ISA, but I mean specific uarch optimizations and features) and won't produce better code for most functions (especially the boilerplate stuff).

                    It's not about skill level, but about wasting time rewriting it. But yes if you can't write proper assembly code (not don't, but can't), you're the same low skilled "dev" that uses Rust because he can't write safe C/C++.

                    There are reasons you shouldn't write assembly, such as maintenance or not using new CPU features on old code automatically, but safety is not one of them.


                    tl;dr invalid comparison, sorry.
                    Valid comparison. The point is that Rust lets skilled C/C++ developers achieve the same level of success with less effort. The same argument can be made about C and C++ for skilled assembly coders, so arguing that you should just use C or C++ is comparable to arguing that you should abandon C and C++ for assembly because the rationale for abandoning Rust is the same.

                    If you are "too manly to use more convenient tools", then you're a fool.

                    Comment


                    • #90
                      Originally posted by ssokolow View Post
                      Valid comparison. The point is that Rust lets skilled C/C++ developers achieve the same level of success with less effort. The same argument can be made about C and C++ for skilled assembly coders, so arguing that you should just use C or C++ is comparable to arguing that you should abandon C and C++ for assembly because the rationale for abandoning Rust is the same.

                      If you are "too manly to use more convenient tools", then you're a fool.
                      WTF are you talking about? Rust is not less effort than a skilled C/C++ developer, in fact it's more because you have to please the borrow checker even in cases where you know it's correct (and don't start about you being wrong, we're talking a skilled dev here). If anything Rust is more effort, but gives noobs the feeling they got it right at least.

                      Comment

                      Working...
                      X