Announcement

Collapse
No announcement yet.

Should GNOME Begin Replacing More C Code With Rust?

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

  • #71
    Originally posted by JeanPaul145 View Post

    I'm thinking that a lot of those defensive posts come from people that have invested significant time in learning and becoming proficient in C++[1], or significant effort in mastering C[2].
    If we assume that to be the case, then their stances suddenly make sense whether you agree with them or not, since nobody likes to see effort they spent go to waste. The only skill needed to see that point is empathy.
    Agreed.

    Originally posted by JeanPaul145 View Post
    Still, I do think that the C/C++ defensives are a little emotionally overinvested in what amounts to nothing more than a means to an end, and would thus themselves benefit from just working with Rust on a side project and experiencing the differences with C/C++ for themselves.

    [1] If you want to write properly working rather than sort-of-working-but-not-really software, then C++ is a stunningly complex language any way you slice it.
    I'm thinking for example things like manual memory management (or having to learn about things like the various modern allocation schemes), but also portability: it is remarkably
    easy to write something that appears like it should work yet turns out not to, on other OSes.
    [2] C is easy to learn, you can read through K&R in a day. Mastering it is a totally different thing though.
    In my personal experience, most developers aren't interested in learning new languages as long as paychecks keep coming for the ones they know. And to be fair, some of the people frequently jumping onto new trends are just doing it to avoid boredom. But I think a lot of emotionally mature people will periodically investigate unfamiliar languages and tools for the right reason: because sometimes among those unfamiliar tools they may find something that enables them to write high quality software faster than the tools they already have.

    I think "sort-of-working-but-not-really" is unfair. Aside from the fact that Firefox and Chrome require periodic updates for security problems I haven't had either crash more than a few times a year. A rewrite in Rust might help further, but I don't think anyone expects it to mean that Rust-based Firefox never crashes and never requires a security fix. And for example the JVM I use at my day job is written mostly in C++, and I haven't had a JVM crash due to bugs in the C++ code in almost ten years.

    Comment


    • #72
      Originally posted by Michael_S View Post
      Agreed.



      In my personal experience, most developers aren't interested in learning new languages as long as paychecks keep coming for the ones they know. And to be fair, some of the people frequently jumping onto new trends are just doing it to avoid boredom. But I think a lot of emotionally mature people will periodically investigate unfamiliar languages and tools for the right reason: because sometimes among those unfamiliar tools they may find something that enables them to write high quality software faster than the tools they already have.

      I think "sort-of-working-but-not-really" is unfair. Aside from the fact that Firefox and Chrome require periodic updates for security problems I haven't had either crash more than a few times a year. A rewrite in Rust might help further, but I don't think anyone expects it to mean that Rust-based Firefox never crashes and never requires a security fix. And for example the JVM I use at my day job is written mostly in C++, and I haven't had a JVM crash due to bugs in the C++ code in almost ten years.
      I did investigate it and within 1 minute i could see the syntax is horrid. Its a language that should not exist. Dlang > rust, but i prefer C++ myself. However i still hate some aspects of c++ but the most important thing is syntax, and that is just horrid in rust.

      Comment


      • #73
        Originally posted by cj.wijtmans View Post

        I did investigate it and within 1 minute i could see the syntax is horrid. Its a language that should not exist. Dlang > rust, but i prefer C++ myself. However i still hate some aspects of c++ but the most important thing is syntax, and that is just horrid in rust.
        Syntax isn't a big deal to me. It takes a week or two to adjust, but after that I don't care any more unless there's some bizarre situation like rampant abuse of implicit variables in Perl 5 or excessive use of operator overloading in any language.

        I do like Dlang a lot, though I'm not sure it's as useful as Rust in places you need manual memory management. D destructors and scope guard statements are good, but I'm not confident they're as default-safe to use as the Rust borrow checker.

        Comment


        • #74
          Originally posted by plonoma View Post

          The language features being added would still quite heavily impact code structure.
          Rust is still too immature as a language and software ecosystem to start writing frameworks in.
          Sorry, but no, it doesn't impact code structure. By your logic, C++ is still too immature a language and software ecosystem to start writing frameworks in because they keep coming up with new standards that change everything. Those recent move semantics really impact code structure. That's the dumbest argument you can make against Rust.

          Software that I wrote when Rust 1.0 released and haven't touched still compiles with the latest nightly. Frameworks have been, and are continuing to be, written in Rust. That's a fact.

          Comment


          • #75
            Originally posted by cj.wijtmans View Post

            I did investigate it and within 1 minute i could see the syntax is horrid. Its a language that should not exist. Dlang > rust, but i prefer C++ myself. However i still hate some aspects of c++ but the most important thing is syntax, and that is just horrid in rust.
            It's a good thing that you're not in charge of decision-making processes, Mr. One Minute Opinions. Rust's syntax and concepts are the result of years of elaborate RFC proposals and revisions to RFCs. You can't just fling poop all over the immense amount of effort that has gone into the RFC processes. Novel ideas are gradually worked into production-grade syntax, like this idea to bring associated type constructors (HKT territory) to Rust.

            As someone who has spent two years with Rust syntax, going back to C++/D syntax is horrible. Type keywords initialize variables? That's a terrible idea. Looping syntax in C++ is also terrible, along with pretty much every other implementation in C++. C++ & D lack good RFC processes to weed out bad design decisions before they make it to production.

            Comment


            • #76
              Originally posted by Michael_S View Post
              Agreed.



              In my personal experience, most developers aren't interested in learning new languages as long as paychecks keep coming for the ones they know. And to be fair, some of the people frequently jumping onto new trends are just doing it to avoid boredom. But I think a lot of emotionally mature people will periodically investigate unfamiliar languages and tools for the right reason: because sometimes among those unfamiliar tools they may find something that enables them to write high quality software faster than the tools they already have.

              I think "sort-of-working-but-not-really" is unfair. Aside from the fact that Firefox and Chrome require periodic updates for security problems I haven't had either crash more than a few times a year. A rewrite in Rust might help further, but I don't think anyone expects it to mean that Rust-based Firefox never crashes and never requires a security fix. And for example the JVM I use at my day job is written mostly in C++, and I haven't had a JVM crash due to bugs in the C++ code in almost ten years.
              To this day, there's never been a security vulnerability found within Rust source code. There have been vulnerabilities discovered in other software that Rust re-implemented, and by which the Rust version was not affected, though. All of those security bugs are pretty much caused by the class of bugs that Rust eliminates: invalid memory accesses.

              Comment


              • #77
                Originally posted by mmstick View Post
                Type keywords initialize variables? That's a terrible idea.
                That is like your opinion man. Unless you can actually substantiate that.

                Comment


                • #78
                  Originally posted by mmstick View Post

                  To this day, there's never been a security vulnerability found within Rust source code. There have been vulnerabilities discovered in other software that Rust re-implemented, and by which the Rust version was not affected, though. All of those security bugs are pretty much caused by the class of bugs that Rust eliminates: invalid memory accesses.
                  Invalid memory access is the most common security bug, but not the only one. The infamous "goto fail" bug was an error in program logic, and it's just as easy to return from the wrong place in a Rust function as it is in any other language. Some encryption algorithm implementations have been cracked because of the use of a poor random number generator.

                  Rust is a huge improvement over C or C++ for many classes of error. But it doesn't mean all security flaws are fixed, forever and ever.

                  Comment


                  • #79
                    Originally posted by Michael_S View Post

                    Invalid memory access is the most common security bug, but not the only one. The infamous "goto fail" bug was an error in program logic, and it's just as easy to return from the wrong place in a Rust function as it is in any other language. Some encryption algorithm implementations have been cracked because of the use of a poor random number generator.

                    Rust is a huge improvement over C or C++ for many classes of error. But it doesn't mean all security flaws are fixed, forever and ever.
                    So "fn" and "let" everywhere doesnt bother you? It hurt me after 5 seconds of reading. To each their own. Also can you substantiate WHY rust is an improvement over C++?
                    Last edited by cj.wijtmans; 03 November 2016, 04:38 PM.

                    Comment


                    • #80
                      Originally posted by mmstick View Post

                      Sorry, but no, it doesn't impact code structure. By your logic, C++ is still too immature a language and software ecosystem to start writing frameworks in because they keep coming up with new standards that change everything. Those recent move semantics really impact code structure. That's the dumbest argument you can make against Rust.

                      Software that I wrote when Rust 1.0 released and haven't touched still compiles with the latest nightly. Frameworks have been, and are continuing to be, written in Rust. That's a fact.
                      Maybe it is a bad example I gave, my apologies, I should have researched this more thoroughly.

                      Hit a nerve there too.

                      Software frameworks from the ground up, new frameworks are written in Rust.
                      With stuff like the changes in error codes and other stuff is giving me the impression Rust needs a bit more development before being ready to start CONVERTING EXISTING frameworks.

                      The crates and libraries being developed are still not developed enough to start making large frameworks in Rust.
                      Why is the following item being discussed as part of the roadmap:
                      This RFC proposes the 2017 Rust Roadmap, in accordance with RFC 1728. The goal of the roadmap is to lay out a vision for where the Rust project should be in a year's time. This year's focus is impr...

                      Rust should have 1.0-level crates for essential tasks
                      Would not having crates for essential tasks be a problem for building a framework?


                      My point is Rust's software ecosystem seems a bit too young to start converting established frameworks to.
                      Start writing libraries in Rust yes. But converting whole frameworks to it? Almost.

                      Comment

                      Working...
                      X