5 ms·
I cannot find the article right now, but it was a wonderful piece on why a language like Rust is by design incompatible with the whole idea/process of making ga
by rollcat 2y ago
I cannot find the article right now, but it was a wonderful piece on why a language like Rust is by design incompatible with the whole idea/process of making games. (I hope it rings a bell for someone who can find it.)
It went something like this: you start with a nice little tidy spec for basic arithmetic; how "a + b" must be the same as "b + a", etc. Then the designer comes back to you and asks for the ability to make numbers blue. You're like wtf but ok, when you add a blue "a" to a non-blue "b", the result becomes blue; you must remove half of your tests (because they no longer even apply) and rewrite the other half to match the spec, and a week of work later the result somehow still makes some mathematical sense. Then the designer comes back to you with the request to make even numbers shoot sparks on death, and to remove all fives...
And it's just how it goes. Games need to be iterated on quickly and efficiently, with a tight feedback loop on what ends up being fun during playtesting, and what doesn't. Rust might be great for writing low-level code / engines, but it will constantly get in your way where you need to respond quickly.
- pjmlp 2y agoIt is from the same author, they link it on the readme.
- rollcat 2y agoSilly me, thanks!
- capitainenemo 2y agoInteresting because there was a rust keynote by kyren arguing the exact same thing for why games were a poor fit for OOP/C++. Arguing for data oriented which rust does well. ... or C I suppose. It might be that rust ecosystem this dev was dealing with was itself draining with continually shifting APIs, but that's not the same as the language itself. https://kyren.github.io/2018/09/14/rustconf-talk.html https://kyren.github.io/2018/09/14/rustconf-talk.html
- consteval 2y agoMost C++ games aren't really OOP C++. They're more loosey-goosey maybe you use some OOP stuff sometimes C++. The problem is C is far too low level. And everything you can do in C, you can do in C++. You just also get things like namespaces and RAII. From a game making perspective, there's no rules anywhere saying you have to write good, readable, C++. You can, and often people do, make amalgamations and monstrosities. You can do this very quickly, and if there's little bugs here and there it's no biggie, because you're just making a game. A segmentation fault is really not the end of the world.
- capitainenemo 2y agoWell... yes. Rust is kinda like nicer C. You can augment the data structures with behaviours. Which kyren notes in her keynote. I just feel the problem of the author of Comfy is not so much with rust-the-language but with the existing SDKs he was trying to build on which were moving targets. Not unsurprising for new stuff.
- consteval 2y agoI wouldn't describe Rust as a nicer C. Rust is a more correct C++, and C++ is a nicer C. Rust isn't actually nicer to program in than C++. It takes longer to produce the same amount of code. The tradeoff is correctness. So now the value of using Rust depends on the value of correctness. In most domains, correctness is very valuable. Game development is one in a million, where correctness really doesn't matter that much. What matters more is velocity and tooling. Even if Rust catches up with C++ in tooling and is stable, I don't believe it will replace C++ in gaming specifically. Because C++ naturally orients itself more towards that super fast development, throw-shit-at-the-wall approach to software. For gaming, that works best.
- capitainenemo 2y agoI was thinking back to the C-based dev I've done which was heavy on tying together data structures with functions that operated on them. Adding behaviours to data structures is way nicer in Rust, so that's the part that I feel would make it attractive to a C developer, in particular a game developer. ... and without the messiness of OOP inheritance in C++ messing with your convoluted game rules... (that was the main thing kyren was focusing on in that keynote) - obviously you don't have to use OOP, but your C++ frameworks probably do, and it's the natural way to do C++ and to augment your data structures with useful behaviours... if you're not doing that, you're kinda back to C-like, and at that point I feel Rust does win again...