7 ms·
For certain things, Rust is painfully slow with no real benefits. We are starting to learn where we should and should not use Rust. If you ask me, Rust is becom
by daghamm 2y ago
For certain things, Rust is painfully slow with no real benefits. We are starting to learn where we should and should not use Rust. If you ask me, Rust is becoming the new Ada.
Update: when I wrote slow, I meant development pace, not runtime performance
- yu3zhou4 2y agoFor what things Rust is painfully slow? You mean runtime or build time?
- olivermuty 2y agoDevelopment time is my guess
- JD557 2y agoThis. I assume it's a similar argument as the one presented in https://loglog.games/blog/leaving-rust-gamedev/ https://loglog.games/blog/leaving-rust-gamedev/ Edit: I just noticed that this article is also writen in the archival reason. I'll leave it here anyway for those that miss it.
- muglug 2y agoYeah the Rust build time tradeoff for non-trivial programmes is acceptable iff the programme is going to be run at least 100x more than the compiler (or if the programme would be useless without the speed increase).
- desdenova 2y agoBuild times are a bit slow, but runtime is just as fast as what you'd get doing the same thing in C or C++. Development time is absurdly faster, though, since you don't spend much time debugging annoying language-design bugs, and can focus entirely in your code's logic.
- fidotron 2y ago> focus entirely in your code's logic That is if your code satisfies the borrow checker out of the gate, fine. I have seen Rust book authors get derailed for years by apparently simple seeming projects that do not.
- wiz21c 2y agoWhen the borrow checker doesn't let you compile, it's either because it can't understand your code (and that's unfortunate and infuriating and costs a lot of time to figure out), either because your code won't be absolutely safe (and so you'd better listen to the BC instead of complaining about it). rust can be very frustrating because it forces you to think up front at a level of safety you may not be used to. That's the issue. I do fairly simple things with rust (i.e. just some threads, no complex data structure (but complex program nonetheless)) and rust safety helps me a lot in reducing the number of bugs.
- orphea 2y agoIt's been a while when I worked with Rust, but when I did I felt like people are misusing Rust references. IIRC, they are supposed to be short-living, i.e. you get a reference, you do your thing with it and then you get rid of it asap. For actually long-living references Rc<> should work pretty fine?
- chuckadams 2y agoLooking at Rust from the outside, I see the borrow checker as something I might slam into all the time, but if it’s all static, then it’s strictness I can get used to; “if it compiles, it works,” right? But now I’m reading that there’s a dynamic borrow checker too, and I’m left wondering: does rust really crash at runtime if two scopes reference the same field at the same time? That sounds like the kind of infuriating footgun as NPEs in a non null-safe language. Does it really work like that?
- steveklabnik 2y agoThe borrow checker is fully static. There are types in the standard library that, if you use them, do runtime checks. If you run afoul of those checks, then yes, you’ll get a runtime failure. (The primary example being RefCell<T> linked in the article linked there, yes.) These types are not super common in Rust code generally, but they do exist and are useful at times.
- stroupwaffle 2y ago[flagged]
- rizky05 2y ago[dead]
- psychoslave 2y agoIsn't zig more or less the closest thing we have for this currently? I really ask naively, without proper insights to give a relevant answer myself.
- Hemospectrum 2y agoZig is safer than C, which is not a high bar to clear. It has safer defaults than C, and makes it a little easier to use test-driven debugging to find memory safety violations, but it has no answer to Rust’s Send and Sync traits or the mutable XOR aliasable reference model. In that sense it’s similar to dozens of other languages older than Rust.
- GardenLetter27 2y agoBut Zig doesn't have a nice package manager like Cargo?
- bobajeff 2y agoI don't see zig being that simple. I think it looks more like rust without the borrow checker. Odin to me looks like a more simple language. Go too would fit that if you want some safety.
- psychoslave 2y agoNice, I wasn’t aware of Odin, thanks.
- pjmlp 2y agoSome would say that would be Zig, although it is more like Modula-2 safety guarantees.
- desdenova 2y agoRust is blazingly fast, though.
- pjmlp 2y agoIt is already great that it managed to bring affine types into mainstream, making many programing languages designers consider how to integrate similar capabilities into existing languages, and maybe put some pressure on WG21 to take security more seriously (I remain a dreamer). Outside very specific use cases, we already have Ada like safety on programing languages with automatic memory management.
- ljm 2y agoA lot of big expectations were placed on Rust; plenty will have turned away and decided the trade-off on development velocity wasn't worth the guarantees of memory safety or the promise of zero cost functional abstractions; not to mention it still requires expertise to write something performant. I've certainly done it myself, dipping my toes in the water out of curiosity and realising it wasn't what I needed. Many people here say that languages like Ruby or frameworks like Rails are dying, or some such, but in reality these languages just carve out their space, settle into it, and become the go-to choice because there's nothing surprising about them any more. If Rust can be considered stable or boring in this way then it will have succeeded where a lot of new and novel languages tend to fade into obscurity.
- pjmlp 2y agoThing is, if one can tolerate automatic memory management (regarless of the form), than the guarantees of safety are already there, with faster compile times.
- bitwize 2y agoEvery time someone on Reddit or someplace asks "What's the appeal of Ada anyway?" I say "Think of Ada as boomer Rust." It turns out that when you need to get the details right and be safe in a systems level language, development can be slow. This is a good thing. Studies with Ada projects compared to C have shown that time and money is saved in the long run due to fewer bugs and less maintenance. You just have to embrace that particular suck because it pays off in the end.
- BaculumMeumEst 2y agoWatching people try to force Rust adoption everywhere over the last decade has been watching a car crash unfold at 0.00000001X speed.
- happyweasel 2y agoMy Productivity tanked when using Rust but I have not written 20k Loc yet. Ownership gets messy when you have a complex mutable application model (worse: oop written according to SOLID principles). At that Point,Just give Up and use ref counting (which you would use in c++ anyway..).
- larschdk 2y agoI still like to believe that the upfront cost will be offset by the lower long term maintenance cost for some types of software. Except, that that is not always the case for gamedev where shitty code can still make good and successful games. You may miss a deadline, but if you are not going to maintain the code base for 20 years, so why spend the effort on quality code?
- pornel 2y agoThe author has one major issue with Rust in gamedev: they can't easily try out new game feature ideas or gameplay tweaks by writing quick and dirty code. Such unfinished code can be obviously buggy and unsafe, but in game dev it matters more to have short feedback loop to try how things feel, than to have a perfectly correct code all the time. Rust doesn't do quick and dirty, and will complain about code quality even when game devs don't even plan to keep the code. This is a substantially different situation from other domains like application and services development, where it's easier to plan what you're going to implement, correctness is more important, and you don't need to try out 20 different JSON parsers to see which one has the most satisfying feel.
- spoiler 2y agoDisclaimer: never actually shipped a game. I've worked with Bevy, and there's it's incredibly easy to write "quick and dirty" to test stuff. I guess the major "downside" you need to account for is that the type system will try to prote you from crashes. Which can be a bit of a chore since youknow it won't crash with the values you've given it. But if you're comfortable with .unwrap and the occasional unsafe while prototyping, it's honestly fine (at least within Bevy). Alternatively, they could try "scripting" behaviour first before implementing it in Rust, although from what I understand bevy's scripting support (I don't think it's explicitly supported, but bevy is very extensible) is still very early in development
- pornel 2y agoECS is like a whole another language on top of Rust, and it is dynamically typed. If you add a scripting language and blueprints, you're shortening the feedback cycles by using Rust less. I like Bevy, but it seems like Rust currently is much better suited for making game engines than the games themselves. Some "RustScript" is needed.
- kaoD 2y ago> ECS is like a whole another language on top of Rust, and it is dynamically typed. Can you elaborate? Or did you mean dynamically dispatched?
- binary132 2y agoI always thought Ada was super cool tbh