this post was submitted on 27 Jan 2024
37 points (97.4% liked)

Rust

7269 readers
28 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] technom@programming.dev 9 points 2 years ago (3 children)

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 5 points 2 years ago

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

[–] LeFantome@programming.dev 5 points 2 years ago

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 3 points 2 years ago* (last edited 9 months ago)

For me the biggest issue is all the undefined behavior 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.