Rust in thunderbird (thunderbird.topicbox.com)
from morrowind@lemmy.ml to rust@programming.dev on 27 Jan 04:34
https://lemmy.ml/post/11099863

#rust

technom@programming.dev on 28 Jan 12:22 collapse

Choosing Rust instead of C or C++ for new projects is a rather light decision. But introducing it into or outright replacing legacy codebase with it is a rather phenomenal undertaking. Fish shell was completely rewritten. Linux is introducing it in no trivial way. I wonder if the woes with C/C++ is that bad.

snaggen@programming.dev on 28 Jan 13:57 next collapse

Librsvg did the rewrite incrementally, so you can choose to only use rust for new code in an existing codebase.

sugar_in_your_tea@sh.itjust.works on 28 Jan 21:35 next collapse

Fish was rewritten for a different reason. Essentially, fish wanted to do more with threads, and making something that worked well was going to involve a large amount of work to ensure it was safe and correct (you don’t want data races in your shell). The main dev and a lot of the contributors were already familiar with Rust, so it made a lot of sense.

And so far, Linux seems to be taking it really slowly. There are drivers in Rust, as well as an optional scheduler. The main language for kernel development is still C.

Rust may not be the best option for all projects, but it can be integrated in with minimal disruption if projects do find value with it.

LeFantome@programming.dev on 28 Jan 23:10 next collapse

Other than having to know Rust, adding Rust to a C code base is not difficult. They play well together.

There is no need to rewrite old code but, once Rust is there, you are free to.

Linux is a bit of a special case as you cannot just blindly use the Rust standard library.

Having to have a Rust tool chain to build with may or may not be an issue.

For some use cases, like BSD or the Linux kernel, platform support is also a consideration.

raldone01@lemmy.world on 29 Jan 12:09 collapse

For me the biggest issue is all the undefined behaviour and unsafe memory.

Taking a look at libraries everyone uses where there are unsafe memory issues for years until someone finds them shows this quite nicely.