Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I 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.



I 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...


I mean, I just don't think this is true. All the most mature entity-component frameworks are built in C++.

C++ is one of the most flexible languages, ever. OOP is a very tiny part of C++. You can 100% do data-oriented designs. And most and engines, do!

> if you're not doing that, you're kinda back to C-like

I don't understand how you can believe this. Maybe you don't have the C++ experience.

You have higher order functions, you have templates, you have compile-time programming. Hell, C++ has higher-kinded types - even Rust's type system can't do that!

C++ is very convenient to program in and very powerful. That's why it's used for games and will continue to be used for games. Rust is not more powerful, in any ways, in that regard. It can do the same shit, but with more headache. Usually that's worth it, but not for video games.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: