Announcement

Collapse
No announcement yet.

More Rust Code Readied For Linux 6.3 - Closer To Having Rust Drivers Upstreamed

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

  • #41
    Originally posted by Ironmask View Post

    Not to sound demeaning, but I'm guessing you haven't used either Rust or C/C++, or don't know how language evolution works.

    The reason Rust is not just safe, but the safest non-pure language ever made (so far) is because of it's ownership system. Rust's ownership system is extremely complex, mechanically speaking (it's easier to understand for end programmers than people give it credit for, but highly complex to actually implement). It's built in to the language for a reason, because the language itself was built around the ownership system. You cannot retrofit the ownership system on to a language, it's literally impossible. If you tried it, you would simply create an entirely new language. And that right there is the issue. Yeah, you technically can retrofit an ownership system in C or C++. It would make a language where zero amount of existing code would compile. So you have, in effect, made a new language that nobody uses and has no support or ecosystem.

    This is why Stroustrup is full of it. It's legitimately impossible to make C++ as safe as Rust without simply adding an entirely new system or meta-language on top of C++, you'd basically be making an entire new opt-in language over C++. That's the biggest rebuttal against his tirade, that even if he accomplished such a butchery of his language, it would merely be opt-in, as in, not default, not the pit of success. It would be an option, and who knows how many people would take it (certainly not 100% of people). And then, if he accomplished it, none of the existing code would work with it. Existing C++ libraries would be just as cumbersome to use from "Safe C++" as it is now from Rust. His argument is "C++ is already here". Well, if Rust is already here, and already safe, why not just work towards using C++ from Rust rather than waiting to work at using C++ from "Safe C++".

    Safe C/C++ is a moot point, because, in effect, you're asking to create a whole new incompatible C-like language and asking everyone to stop using existing C/C++ and go to the "safe C/C++" and modify all their existing code to work with the new "safe C/C++". Guess what, that's literally what Rust is. And that's why Stroustrup's argument is completely irrelevant.
    I've used Rust, and a little bit of C and a even tinier bit of C++. I am familiar with Rust's ownership system.

    I am not so good at language design and understand all these things but when I read that Stroustrup wrote his post I didn't read it all, and didn't understand it all, but I had a feeling similar to yours, my feeling was that he was full of it. I wanted to bring it up though, because I am not so good at this, so maybe it would be possible to make C safer with whatever plans Stroustrup has for C++, but I guess you're right, and I guess my initial gut feeling that Stroustrup was full of it was right.

    Comment


    • #42
      Originally posted by Berniyh View Post
      Which one is Rust?
      Rust is the one that is used.
      People seem to like it, but I have a few complaints about it.
      • There is no async functions in traits. This is coming though.
      • Async are segregated to different isolated isles of ecosystems that are incompatible, like if you pick a async runtime (such as Tokio) then all your async libraries you use must be written for Tokio too.
      • My match statements get nested and look like a Matryoshka doll, but that has probably more to do with me being inept than the language itself.

      Originally posted by Vistaus View Post

      Of course he has to say that. You think he would trash-talk his own product???
      I am not saying he should trash talk his own product, but I expected him to be more neutral and mature and be able to think objectively.
      We're all thankful to Bjarne Stroustrup for C++ which has been great to programming and computing, it has been hugely influential. In the times of COBOL and Fortran then C++ was amazing, but now its new times, and maybe C++ has served its purpose and now its time for new languages such as Rust, Swift and Zig.

      Comment


      • #43
        Originally posted by mmstick View Post

        In May 2022 over 70,000 developers told us how they learn and level up, which tools they’re using, and what they want.




        If everything seems like a joke to you, it's because you're a 🤡.
        That's not proof. They can write anything, or ask, anyone they want.

        And the fact that it's still not the most widely used (by far) shows that yes, indeed, either those developers don't matter, they're lying, or the results are made up.

        Clown.

        Comment


        • #44
          Originally posted by silmeth View Post
          What he “literally said” is: “I will continue to use other programming languages, that are already memory-safe, for my new projects, as will the majority of programmers.”

          And that’s true, definitely more programmers start new projects in Rust + Java + Python + JS + Kotlin + C# + Ocaml + Haskell +Elixir + … than those who start new projects in C++ (or in C, or in Assembly). Even if there are still more C++ programmers than Rust programmers, that sentence wasn’t about Rust alone, nor only about low-level close-to-metal projects. He makes that very clear earlier, when saying “As I mention before, safe programming languages have existed for a long time. Many programming projects that in the early 90’s would have been done in C or C++ have in fact been done in safe programming languages instead (…)”.

          Of course, there are still domains where C++ or C are more common (definitely more C++ programmers in gamedev than Rust people, though I guess most gamedevs actually write C#), embedded (though Rust becomes more and more popular), etc.

          But the point made implicitly is that with Rust people tend to use the language in the whole stack, all the layers – not just the lowest-level library with higher-level logic calling to it from Python/Java/whatever – because Rust works as a relatively pleasant high-level language too (even if one difficult for quick prototyping, you probably want something like Python for that). While the unsafe languages are limited to the lowest-level stuff where you need all of the control, and most (but by no means all, there are fans of C++ out there, of course) programmers avoid those languages whenever they can.
          Well, I didn't think he was talking about non-compiled languages, cause those should be memory safe by default, at least I thought.

          Comment


          • #45
            Originally posted by Ironmask View Post

            Not to sound demeaning, but I'm guessing you haven't used either Rust or C/C++, or don't know how language evolution works.

            The reason Rust is not just safe, but the safest non-pure language ever made (so far) is because of it's ownership system. Rust's ownership system is extremely complex, mechanically speaking (it's easier to understand for end programmers than people give it credit for, but highly complex to actually implement). It's built in to the language for a reason, because the language itself was built around the ownership system. You cannot retrofit the ownership system on to a language, it's literally impossible. If you tried it, you would simply create an entirely new language. And that right there is the issue. Yeah, you technically can retrofit an ownership system in C or C++. It would make a language where zero amount of existing code would compile. So you have, in effect, made a new language that nobody uses and has no support or ecosystem.

            This is why Stroustrup is full of it. It's legitimately impossible to make C++ as safe as Rust without simply adding an entirely new system or meta-language on top of C++, you'd basically be making an entire new opt-in language over C++. That's the biggest rebuttal against his tirade, that even if he accomplished such a butchery of his language, it would merely be opt-in, as in, not default, not the pit of success. It would be an option, and who knows how many people would take it (certainly not 100% of people). And then, if he accomplished it, none of the existing code would work with it. Existing C++ libraries would be just as cumbersome to use from "Safe C++" as it is now from Rust. His argument is "C++ is already here". Well, if Rust is already here, and already safe, why not just work towards using C++ from Rust rather than waiting to work at using C++ from "Safe C++".

            Safe C/C++ is a moot point, because, in effect, you're asking to create a whole new incompatible C-like language and asking everyone to stop using existing C/C++ and go to the "safe C/C++" and modify all their existing code to work with the new "safe C/C++". Guess what, that's literally what Rust is. And that's why Stroustrup's argument is completely irrelevant.
            What do you mean with "opt in"? Do you mean like having to write "const" instead of it being the default? How about get good then? This isn't even about programmers making mistakes or having to think logic. You can train yourself to instantly put that keyword by default, and if you realize it's not const, you drop the const. Muscle memory.

            C++ doesn't invalidate moved objects or pass ownership by reference by default. They could add something like that though. Even a compiler extension would do the job. You talk like it's rocket science.

            But your problem is that it's not the "default" as in "you can use normal references and not get safety". Well, you can use "unsafe" in Rust, so what's the problem again? Don't like the "unsafe" blocks? Well maybe you should learn to "not like" the normal references then.

            Comment


            • #46
              Originally posted by Weasel View Post
              That's not proof. They can write anything, or ask, anyone they want.

              And the fact that it's still not the most widely used (by far) shows that yes, indeed, either those developers don't matter, they're lying, or the results are made up.
              You're putting a lot of effort into misinterpreting a clear and useful data source.

              The SO survey is open to all, it's becoming fairly well-known, and gets some answers from outside the SO community. Every survey has a sampling bias, but good luck determining which community (if any) gets over-represented. There's no obvious outlier in the data.
              ​​
              The "most loved/dreaded/wanted" metric is simply a nice way to format the results of the "I have used FOO recently" and "I expect to use FOO in the future" yes/no questions for every language in the survey. The love/dread ratio is within people that actually use the language, of course it doesn't correlate exactly with the overall language use stats.

              Loved/dreaded/wanted remains a very interesting metric, for example it's a good clue for the future adoption of the language. Rust being "loved" correlates well with Rust's usage trend according to the SO survey (gaining 1-2% every year, IMHO impressive for a systems programming language).

              Comment


              • #47
                Originally posted by moltonel View Post
                You're putting a lot of effort into misinterpreting a clear and useful data source.
                Don't bother talking to him, he's just an angry troll.

                Comment


                • #48
                  Originally posted by uid313 View Post
                  I am not saying he should trash talk his own product, but I expected him to be more neutral and mature and be able to think objectively.
                  He's talking about his own product. Objectivity is out of the question.

                  Comment


                  • #49
                    Originally posted by Vistaus View Post

                    He's talking about his own product. Objectivity is out of the question.
                    I don't know. I don't see the Xorg devs saying "X is still almost good! Just give us a decade more to make it good! Come on, everyone uses Xorg, we shouldn't abandon it just because it's a horrible bloated mess!", they all went on to Wayland. Same for Pottering and PulseAudio, he knows thats crap too and replaced it with PipeWire.
                    I think Stroustrup is genuinely just delusional.

                    His sole valid argument - That there is a ton of C++ code that still needs to be supported - does not necessarily mean we should bother putting C++ on yet more life support. A better solution would be to make languages that compile to C++, which allows continuing to maintain existing C++ software without having to still use C++. This is something that both Google and Andreas Kling are independently working on (Carbon and Jakt, respectively). Jakt is especially interesting because it's specifically being made to convert Serenity OS to a language that isn't C++. And when you think about it, C++ was originally made to essentially replace C. I think the next step now is to make languages to replace C++ while being compatible with it. Then, when a project has been fully converted, the compiler can change it's target from C++ to a direct binary. It's a much more reasonable and sustainable option than simply rewriting everything from scratch, which is impossible. It's not the mainstream solution. The mainstream solution is to just componentize existing software and allow for adding Rust modules to it. Which is also fine. Arguably better, since Rust is a pre-existing general-purpose language by itself and not built on the less stable foundations of transcompiling.

                    Comment


                    • #50
                      Originally posted by Ironmask View Post

                      I don't know. I don't see the Xorg devs saying "X is still almost good! Just give us a decade more to make it good! Come on, everyone uses Xorg, we shouldn't abandon it just because it's a horrible bloated mess!", they all went on to Wayland.
                      But X is dead; C++ is far from dead. Even if Rust is better and gaining traction, C++ is still big. X is also still big, but more in the sense of legacy big, not because it's actively being worked on. So apples to oranges.

                      Comment

                      Working...
                      X