Announcement

Collapse
No announcement yet.

GNOME's SVG Rendering Library Migrating To Rust

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

  • #11
    I'm a hardcore C programmer and have a lot of Rest envy. I wish I were able to use Rust on practically all my projects. It would allow me to work faster and have fewer bugs, and basically have almost all of the advantages that C gives me.

    Unfortunately, the design decision in Rust was that interfacing with the C ABI would require some work in most cases (wrapper code). This is reasonable all in all, considering that Rust really represents a necessary fresh start on low-level programming. But the costs right now are such that it's just non-trivial to have some of your code in Rust and some in C. It makes the most sense when you have a completely isolated bunch of code that could fit in its own "library," as is the case with SVG rendering. GNOME made a good decision here: it will improve the quality of the product and make it easier (and faster) to fix bugs when they appear.

    Bottom line: Rust is awesome, but C is definitely here to stay.

    Comment


    • #12
      Originally posted by tildearrow View Post
      Why??? Why is everything moving to Rust?
      Maybe because it makes it easier to write code that is stable, secure, free from memory leaks and more easily parallelised? Why wouldn't one want that, especially if it comes with backwards API compatibility?

      Comment


      • #13
        Originally posted by tildearrow View Post
        Why???
        Because GNOME is not bloated enough. End of the 90's it was covered with a gazillion of programming languages and even nowadays they haven't changed much in that regard. GNOME is still covered full of "programming language" dependency.

        Comment


        • #14
          Originally posted by emblemparade View Post
          It (Rust) would allow me to work faster and have fewer bugs [...]
          This is blatant BS! No programming language will cover you from making any kind of bugs. And I really doubt that you will work faster because you switched to RUST. The speed gains you believe to have, will be paid with other stuff, related to your RUST work, in other corners during your work day.

          Comment


          • #15
            Originally posted by Candy View Post

            Because GNOME is not bloated enough. End of the 90's it was covered with a gazillion of programming languages and even nowadays they haven't changed much in that regard. GNOME is still covered full of "programming language" dependency.
            On the contrary, moving to Rust has decreased the amount of memory that librsvg consumes and reduced required CPU cycles. Rust makes it very easy to write efficient code with optimizations that are otherwise dangerously error-prone in C or C++. It also allows one to conveniently perform mass refactoring on a whim with zero issues, which is something that C and C++ codebases cannot do. The refactoring capabilities alone make it invaluable to open source development.

            Originally posted by Candy
            This is blatant BS! No programming language will cover you from making any kind of bugs.
            That's where you're wrong. The lifetimes, borrowing, and ownership mechanics of Rust prevents an entire class of bugs from ever appearing in a build. The use after free bug, for example, is no longer an issue when you're using Rust. Segmentation faults occurring during runtime are effectively reduced to zero. Data races can be detected at compile-time and will refuse to compile.

            Originally posted by Candy
            And I really doubt that you will work faster because you switched to RUST. The speed gains you believe to have, will be paid with other stuff, related to your RUST work, in other corners during your work day.
            I think you'll find that it's re-iterated again and again within the Rust community that we work faster in Rust than we do in C, C++, or even Go. I can perform a massive refactor of Rust source code in a matter of a few minutes and be content knowing that the first time I compile, it works 100% and passes all tests. Someone's just envious that they haven't taken the time to learn Rust.

            Comment


            • #16
              Originally posted by mmstick View Post
              The refactoring capabilities alone make it invaluable to open source development.
              Look! I've see people hyping VALA (or Vala) a couple of years ago and they came up with all the good pro's why everyone has to use Vala. VALA was claimed to do things better than C. And where is it now ? Does anyone still use it ? Ever programming language inventor claims that his (or her) programming language is the best and that it solves so many issues better than any other language.

              People use C, Go, Java, C++, Rust, ... for whatever reasons and they will continue to do so. Programming languages can be some sort of religion to people.

              Originally posted by mmstick View Post
              I think you'll find that it's re-iterated again and again within the Rust community that we work faster in Rust than we do in C.
              That wasn't my point! I am quite sure, that you can nail down code lines faster in Rust than in C. But will this make you "work faster" ? In a practical work day you set yourself some milestones. Once the milestone is reached you probably set the day off for the rest of the day and continue your next milestone a day (or couple of days) later.

              Just because it's claimed that Rust makes you work faster, doesn't mean that you get more done. It's the human nature to get only the things done that you really want to get done and not because someone (or something) drives you to get even more done.

              I would get more done within a day, if I start the day at 06:00am rather than 09:00am and work till 10:00pm rather than 05:00pm. But the human nature inside me tells me that I only want to get thing XYZ done and that's my daily goal.

              Comment


              • #17
                Originally posted by Candy View Post
                Look! I've see people hyping VALA (or Vala) a couple of years ago and they came up with all the good pro's why everyone has to use Vala. VALA was claimed to do things better than C. And where is it now ? Does anyone still use it ? Ever programming language inventor claims that his (or her) programming language is the best and that it solves so many issues better than any other language.
                How is Vala in any way, shape, or form, equivalent to Rust? It's not even a proper language. You speak as if Rust's statements are unfounded claims. Rust has an insurmountable degree of evidence and facts for you to sift through. Even the language design is freely open to discussion with a dedicated Github project specifically for handling language RFCs. It is also not the project of one or a few, but many. A number of the developers are even computer scientists with PhDs. Heck, the Rust compiler itself was bootstrapped with OCaml rather than C or C++.

                Originally posted by Candy
                People use C, Go, Java, C++, Rust, ... for whatever reasons and they will continue to do so. Programming languages can be some sort of religion to people.
                Maybe you should listen to your own advice, as you're pretty much religiously spitting at Rust's achievements purely out of spite.

                Originally posted by Candy
                That wasn't my point! I am quite sure, that you can nail down code lines faster in Rust than in C. But will this make you "work faster" ? In a practical work day you set yourself some milestones. Once the milestone is reached you probably set the day off for the rest of the day and continue your next milestone a day (or couple of days) later.
                Of course you will work faster in Rust, and thus achieve more meaningful 'milestones' within the same day. In fact, I'm sure a number of milestones for C and C++ projects is fixing fatal bugs that would have been otherwise avoided had you written software around Rust's borrowing and ownership model. Rust is a necessity for modern day projects, especially large scale projects where failure is not an option. Rust has a large backing because we're all tired of the constant fatal bugs in C and C++ codebases that make maintaining projects like a web browser or game engine pretty much impossible. Rust is safer than Haskell, so the same joke about taking an act of God to crash a Haskell application applies to Rust as well, only Rust can do this without a garbage collector.

                Originally posted by Candy
                Just because it's claimed that Rust makes you work faster, doesn't mean that you get more done. It's the human nature to get only the things done that you really want to get done and not because someone (or something) drives you to get even more done.
                If it walks like a duck, looks like a duck, and quacks like a duck, it's a duck. There's insurmountable evidence to display that developing in Rust allows you to write software solutions quicker, and to do so efficiently.

                First, you deal with bad logic errors that can lead to fatal consequences early in the development process. There was a series of discussions over the last week or so regarding Rust on Rust's reddit board, and one of these discussions compared Rust to being like a drug that gives you the hangover first through stern compiler messages, and then you happily develop your application free of error after that. You cannot tell me that it is better to develop a solution with fatal flaws, and then later go back and try to change all the foundations to fix these flaws, which may require redesigning everything from scratch.

                Second, as a result, you are able to safely write your software as efficiently as you want, and quickly switch over to spinning multiple threads to do your task in a multi-threaded manner with minimal changes. This is additionally aided in the fact that refactoring is a breeze thanks to the type system.

                Third, Rust provides access to Cargo and the entirety of the Crates.io community repository alongside a convenient Docs.rs service. It's even sweetened by the fact that Rustup makes managing your toolchains and cross compiling stupid simple. Never before have we had a programming language that has put so much effort into developing a community and providing community resources. We live in the age of the Internet, so it's about time we leveraged the Internet to increase development rate of systems programming tasks. Other languages are still designed around the idea that software engineers mostly develop code while offline. This is false.

                Originally posted by Candy
                I would get more done within a day, if I start the day at 06:00am rather than 09:00am and work till 10:00pm rather than 05:00pm. But the human nature inside me tells me that I only want to get thing XYZ done and that's my daily goal.
                Entirely irrelevant to the discussion.

                Comment


                • #18
                  Originally posted by Candy View Post
                  Look! I've see people hyping VALA (or Vala) a couple of years ago and they came up with all the good pro's why everyone has to use Vala. VALA was claimed to do things better than C. And where is it now ? Does anyone still use it ?
                  In the proprietary world, if some product doesn’t catch on after, say, five years, then the company is forced to give up on it, one way or the other *cough* Windows Phone *cough*. Either they find some other way to make money, or they go out of business.

                  But in the Open Source world, we have the entire history of computing to draw on, at our leisure. For example, Python and Linux have been around a quarter of a century. In 1996, they were still niche interests, but now they both dominate the computing world.

                  I even look at Lisp, which goes back over half a century, and consider that there are some intriguing ideas there. It needs a more standardized library and runtime environment—unfortunately, the Common Lisp standard predates the dominance of POSIX-type systems, so it is full of compatibility rigmarole to cater for weird things like VMS pathnames. Once all that cruft is ejected, the result could be quite a usable language.

                  So don’t be too quick to write off any Open Source product as a failure. Very possibly, it is a sleeper whose time has not yet come.

                  Comment


                  • #19
                    This is really good news ! Now I wish libpng and libjpeg would shift over, those have so many CVE's again and again.

                    Comment


                    • #20
                      Originally posted by funfunctor View Post
                      This is really good news ! Now I wish libpng and libjpeg would shift over, those have so many CVE's again and again.
                      Exactly. Image format libs are some of the most exposed code out there and one of the easiest to exploit if vulnerable. Implementing them in a language that enforces military discipline can only make the Web a better place for everybody.

                      Comment

                      Working...
                      X