Announcement

Collapse
No announcement yet.

Should GNOME Begin Replacing More C Code With Rust?

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

  • mmstick
    replied
    Originally posted by alpaca View Post

    In a certain way it's already being done through WebAssembly which is experimentally supported by Rust.
    https://hacks.mozilla.org/2016/10/we...owser-preview/
    I don't see WebAssembly replacing Javascript, but merely being an extension to it.

    Leave a comment:


  • mmstick
    replied
    Originally posted by Michael_S View Post
    I'm trying to be practical. Points in favor of Rust:
    1. The static type system protects against buffer overruns, use-after-free errors, and shared mutable state race conditions. That's a huge security win - the Linux kernel has some of the best C developers in the world, Chrome has some of the best C++ developers in the world, and those kinds of errors still routinely occur. Writing secure C or C++ is hard, multi-billion dollar companies that can afford the best talent in the world still have errors. You can get it right 999 times and wrong once and still get owned or annoy your user with a crash or hang.
    2. All of the type system overhead is at compile time, the runtime gives C-like performance.

    Points against Rust:
    1. The GNOME project code is enormous. A rewrite in any language, even if they started over in C, would take a very long time. The only practical path is the one taken by Mozilla with the Servo project - start a parallel rewrite of components, and then swap the Rust modules in piecemeal for the originals as they mature. It works, but it's slow. Servo is four and a half years old and it's far from finished.
    2. Many of the core GNOME contributors are already world class C developers, and the code they know best is the existing GNOME C code. It's not sexy, but maintaining production tested code is often a better investment of time than throwing aside thousands of hours of work for the joy of a clean start with the hottest tool.

    I'm curious to see what they decide, I can see the advantages of either choice.
    There's no need for a parallel rewrite. There are established guides and demonstrations on how to port an application to Rust piece by piece over time. Take a C function, rewrite it in Rust, then write test units for that function, and link it back. That way, you can keep your existing C code, and you can start implementing new functionality in Rust, or rewriting old functionality in Rust. The areas that are the most bug/error prone can be the first to be rewritten, so that we can experience the benefits on Rust on day one.

    Leave a comment:


  • Michael_S
    replied
    I'm trying to be practical. Points in favor of Rust:
    1. The static type system protects against buffer overruns, use-after-free errors, and shared mutable state race conditions. That's a huge security win - the Linux kernel has some of the best C developers in the world, Chrome has some of the best C++ developers in the world, and those kinds of errors still routinely occur. Writing secure C or C++ is hard, multi-billion dollar companies that can afford the best talent in the world still have errors. You can get it right 999 times and wrong once and still get owned or annoy your user with a crash or hang.
    2. All of the type system overhead is at compile time, the runtime gives C-like performance.

    Points against Rust:
    1. The GNOME project code is enormous. A rewrite in any language, even if they started over in C, would take a very long time. The only practical path is the one taken by Mozilla with the Servo project - start a parallel rewrite of components, and then swap the Rust modules in piecemeal for the originals as they mature. It works, but it's slow. Servo is four and a half years old and it's far from finished.
    2. Many of the core GNOME contributors are already world class C developers, and the code they know best is the existing GNOME C code. It's not sexy, but maintaining production tested code is often a better investment of time than throwing aside thousands of hours of work for the joy of a clean start with the hottest tool.

    I'm curious to see what they decide, I can see the advantages of either choice.

    Leave a comment:


  • timosa
    replied
    Originally posted by michal_229 View Post
    I think it is a good idea. I see many benefits (thread safety while being performant, no GC, zero cost abstractions, no need of maintaining Vala, Rust will have broad support).
    Gnome folks are quick to embrace new cool technologies, but they also seem to be quick to dump them when new cool stuff appears. I hope this doesn't happen with Vala because it's a nice language to develop Gnome apps.

    Leave a comment:


  • alpaca
    replied
    Originally posted by GrayShade View Post
    I would rather they replaced JavaScript with Rust.
    In a certain way it's already being done through WebAssembly which is experimentally supported by Rust.
    Since the last WebAssembly milestone we reached in March, we’ve been hard at work in the WebAssembly Community Group to define a standard and to implement that standard in our ...

    Leave a comment:


  • plonoma
    replied
    Should GNOME Begin Replacing More C Code With Rust?
    Too early. Rust both the language and very important libraries providing basic functionality are still undergoing too much change.
    There are still important bugs to fix like this one: https://github.com/rust-lang/rfcs/issues/811

    Leave a comment:


  • JonathanM
    replied
    I don't see GLib being replaced soon, it's not something that you can just replace with something else and move on. If using Rust leads to safer and more readable code while maintaining backwards compatibility with software using the current C ABI, then that should be reason enough to move to Rust. C definitely isn't dead yet, but I think it is time to move on to something better.

    Leave a comment:


  • liam
    replied
    Originally posted by grigi View Post

    Having been in the Ruby thing at a time, I could say that it is unique to the Ruby community in how they always chase the next-big-thing, mostly because they find Ruby both awesome and revolting at the same time. Me, I'm actually glad I moved on from Ruby. Many reasons, the language is reasonable, but the community is toxic. It is also very PERL-like in how much pain legacy apps cause you.
    Fascinating insight, as I've had only the most tangential contact with the Ruby community.
    Thanks.

    Leave a comment:


  • smitty3268
    replied
    Originally posted by eigenlambda View Post
    Applications have been written in whatever language for some time, a decade ago, everyone was talking up C# and RhythmBox was written in C#, as was Tomboy Notes. This guy wants to write applications in Rust? The great thing about gobject is that you can use it in any language, because it's a carefully crafted object system for desktop use.
    I'd say the fact that people are constantly trying to come up with these alternatives to C (C#, Vala, Rust, etc.) just shows how unhappy certain devs in the community are with it. There's a need, and they can't solve it with the current tools. There's also a group in Gnome that is extremely loyal to C, though, which is why i have doubts this will ever be resolved. At least not any time in the near future.

    But this guy doesn't want the burden of maintaining core libraries, which is fine, and he should keep his mouth shut about things he doesn't understand.
    Oh, the irony.

    Leave a comment:


  • grigi
    replied
    Originally posted by liam View Post

    Yes. If also works with dynamic languages like ruby and Python (at least, but probably others). For some reason there being a surprising amount of buzz in the Ruby community with regards to rust. This post (https://m50d.github.io/2015/09/28/wh...kes-sense.html) acknowledges it but doesn't provide a satisfactory answer, imho.
    Having been in the Ruby thing at a time, I could say that it is unique to the Ruby community in how they always chase the next-big-thing, mostly because they find Ruby both awesome and revolting at the same time. Me, I'm actually glad I moved on from Ruby. Many reasons, the language is reasonable, but the community is toxic. It is also very PERL-like in how much pain legacy apps cause you.

    Leave a comment:

Working...
X