Hacker News new | ask | show | jobs
by fire_lake 535 days ago
The promise is to write the whole game in Rust, rather than having a split between C++ and a scripting language. The most common example of this is Unity with C++/C#.

Having one language makes certain debugging tasks easier and can lead to faster execution.

Using only one language is difficult in C++ due to the lack of garbage collection.

What the Rust community is finding out is that it is also difficult in Rust due to compile times and the rigid borrow checker rules.

2 comments

Doing whole games in C++ has been a thing for decades, granted with plenty Assembly in the mix, since Watcom C++ days in MS-DOS, or PlayStation being the first console with a C and C++ SDK.

There was no garbage collection in all those 8 and 16 bit home computers and game consoles programmed in straight Assembly.

If Rust can't top this, then its value for game development community isn't as great as many think it is.

Of course it can be and has been done, but it takes much more developer time than writing less efficient code in a managed language.
Now take in consideration that when using a single language, doing in Rust takes much longer than C++, even without taking into consideration the existing middleware engines, and support for hot code reloading.

Also that stuff like SDL and SFML are pretty much the go tool for DYI folks, and Khronos standards are all based in C and C++.

Additionally, if a managed language is good enough, and does support compilation to native code via AOT, and the middleware tooling, it makes Rust's selling point even weaker.

Which is what you see in how Unity/HPC#/NativeAOT, FNA/clang, Swift, Java/Kotlin (on Android see XR), already offer today.

I think we are agreeing :)
In a way yes, although seeing something like Unreal in Rust, with the same tooling polish, would be quite interesting.

Bevy might eventually get there.

I added the Lua scripting layer to FS2Open. It’s very useful for not-quite-coders. There are a lot of projects where the founders end up doing everything because the other contributors don’t stick around permanently.
That is how Lua got famous in first place, scripting language for games.
Rust does not suit for scripting. The goal of scripting is to write code more easily without worry of system programming concepts like memory management.