6 ms·
Rust is good at solving certain scaling issues in large applications: Servo, the lead usecase for Rust, can safely take many parallelizing optimizations that wo
by jungler 8y ago
Rust is good at solving certain scaling issues in large applications: Servo, the lead usecase for Rust, can safely take many parallelizing optimizations that would be unfeasible to debug anywhere else.
That does not make it a defacto winner for any other problem space. For games, for example, having to reason about concurrency is the status quo for most of the gameplay code regardless of the memory management system, and tightening memory only addresses a fragment of the problem space, because dynamic memory allocation is not a primary requirement(fixed sets of assets and fixed design constraints mean that a heavily static, early-binding approach to game coding works for most things, most of the time - so the difficult errors will tend to surface outside of memory management as an odd runtime behavior). [0]
As a drop-in "better C" it's not a great fit, either, because the focus is on making these in-the-large problems a top concern at all times. It creates friction in migrating to Rust, leaving the floor open for a smaller language that operates at the lowest levels of safety, doing its best to be both C-compatible and improve the parts that can't be addressed by leveraging or patching up the existing C ecosystem.
Zig is my top pick for a language that can address this niche, though it's still an early stage project.
[0] AAA-scale code can still benefit, of course. Most games aren't AAA.
- stochastic_monk 8y agoIn my lab, we’ve been discussing it seriously for a while. We think it’s probably best-suited for a highly multithreaded environment which can’t be trivially parallelized. Until we need that in particular, C++ will most likely meet our needs quite well.
- eridius 8y agoRust’s solution to concurrency is a hell of a lot more than just solving memory management. As long as you avoid `unsafe`, Rust statically prevents all race conditions. Rust also makes it so if you can parallelize something, then you’ve proven that it’s safe to parallelize it, and therefore you can parallelize complex systems in Rust that you simply wouldn’t have the confidence to do with other languages.
- steveklabnik 8y agoRust prevents data races, not race conditions.
- eridius 8y agoYou're absolutely right, I meant to write "data races" there.
- ArthurBrussee 8y agoJai is trying to fit that C space too. Similair ideas to Zig, but more aimed at the games industry. Curious to see which ends up gaining more traction (if either do, fingers crossed)
- eggy 8y agoAnother vote for Zig. I am intrigued with Rust, but don't get too far with it as with other languages, but understanding its mission statement is a lot more comprehensive. The Rust Programming Language book is very well written, however, by the end of the book it feels like you are just learning the language with no stimulating examples. I am using Zig, and making great progress with my personal projects, and look forward to being much more productive in the near future.