r/rust_gamedev • • Dec 02 '18

why use rust to develop games?

why choose rust instead of c++

what are the advantages of rust

can rust be a standard in the development of games   

11 Upvotes

10 comments sorted by

16

u/nqe Dec 02 '18

Do you like Rust more than C++ as a language? If yes then choose it, else choose C++. Both give similar performance.

Many Rust fans wrote C++ previously and found Rust to be much easier at writing correct, safe, and performent programs. One big downside is that Rust is very new compared to C++ so its ecosystem is not anywhere as well developed.

1

u/myNameIsJeff2_0 Dec 02 '18

I really like rust

I would like to dedicate myself exclusively to rust

can rust be a good language for the development of games in 5 to 10 years are you sure that rust will not be the next "D" just an easy attempt to kill c / c ++      could c ++ share the gamedev niche with rust

2

u/eugene2k Dec 02 '18

Unlike D rust doesn't have GC and that's what makes it applicable in the same situations you would usually use C++ in. Rust gives you the same control over the performance of your program as C++; D doesn't.

1

u/nqe Dec 02 '18

If I'm not mistaken you can disable GC in D, but not sure on the ergonomics of using the language after. I would bet it's not as nice as Rust though I may be biased :)

1

u/nqe Dec 02 '18

C++ and Rust already share the gamedev niche seeing that there a few game studios that have adopted Rust, though clearly C++ as the incumbent has a much larger usage. This will likely remain the case for a long time.

Honestly though I wouldn't be worried about the language too much if you're just starting out. Good programmers know many languages to a level they can use them competently. Pick either C++ or Rust and go make a simple game. If you didn't enjoy the experience choose the other language and try it out.

If you're looking to get employed quickly though C++ is the safer choice.

If looking for suggestions, a good quick project to get a feel for either language is Tetris. Would recommend kiss3d if using Rust for its simplicity (and it compiles to wasm!) but there are many just as good options.

At the core of it all the overlap of knowledge between Rust and C++ is probably > 90% but that 10% diff is a bit frontloaded since learning the language comes first before learning the other skills.

1

u/auto-cellular Dec 02 '18

If you are able to build a working game written in Rust, you'll adapt to whatever language life throws at you next. However, games are seldom written from scratch in low level environnement (like rust and C++) nowaday.

1

u/myNameIsJeff2_0 Dec 02 '18

my english is bad

1

u/forestmedina Dec 02 '18

im trying to decide about this, i think rust is cleaner than c++ and the tooling is way better, but the ecosystem of rust is nothing compared to c++. The best thing you can do is make a simple game in both languages and compare what gives you better results,

1

u/auto-cellular Dec 02 '18

what c++ feature do you feel you would miss ?

2

u/forestmedina Dec 03 '18

i think that if i decide to use rust , i will try to use with the rust mindset and not the c++ mindset. For example function overloading is a feature that i definitely miss at first, but there are ways to work around that, and is not that important when you take in accout all what you get with rust.

The major issue for me is the ecosystem, to give a example i think the only usable library for physics right now is nphysics, and in other areas there are no mature libraries.