mystran wrote: ↑
Mon May 17, 2021 12:31 pm
So like.. what exactly is Rust supposed to do for me?
Speaking as a Rust user (and addressing everyone in the thread, not just you): If you have any doubts of this kind, don't use Rust.
The Rust community, like the C++ and Java communities before it, certainly contains many enthusiasts. By this I mean people who have both a shallow understanding of something and a sentimental attachment to it. They don't grasp the engineering tradeoffs involved, and they confuse their sentimental feelings for technical superiority. It's a phase a lot of people go through. We're on KVR, so we're surrounded by relevant examples, as well as counterexamples. They're vocal, but they're hardly the entirety of any community.
of Rust are all veterans. They have been burned repeatedly by the drawbacks and limitations of other technologies, particularly C++ (but also OCaml, Haskell, Java, Cyclone...). They're conscious of the costs and benefits of the tradeoffs they choose to make. I'd listen to them and ignore the enthusiasts as much as possible, because the enthusiasts didn't make any of those decisions in the first place. And as annoying as the enthusiasts can be when they yell about using Rust for everything, the designers are pretty clear about some reasons why you shouldn't.
If you're primarily modifying existing code, and it's not written in Rust, don't use Rust. Switching to Rust means writing new code.
If your team is a small number of veterans in constant communication, and you religiously review and test each other's code, don't use Rust. Many parts of the design aim to catch mistakes that slip through code review, especially in larger teams where some programmers are less experienced.
If your code is strictly and reliably single-threaded, don't use Rust. Many of the safety features are specifically designed around the hazards of concurrent code.
If you deploy code built in debug mode, don't use Rust. Many of the "zero-cost" abstractions rely on the optimizer removing redundant operations, such as bounds checking inside a loop. (I can't imagine this biting an audio plugin, but weirder things have happened.)
If your code is specific to a particular platform, there may be no point using Rust. In fact, if your code runs on embedded processors that LLVM can't target, you cannot
use Rust. All of the C++ and assembly I've written in the past seven years has been for such processors. The future might be different, though, considering ARM's inexorable march towards world conquest at every level of the supply chain.
The community that actually matters to your product consists of your team and your customers. If your teammates (or customers) want to do something that Rust would make easier, that's when you should consider using Rust.
All that said, though, the GUI situation is getting really good. I prototyped something in egui the other day (for editing a custom file format) and it was worlds easier than the Flutter version I wrote a few months ago.