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

To be fair, Rust may be the first modern language seemingly designed around the same set of problems that we encounter in Game Development. I'm actually pretty surprised that it's as little known in GameDev as it is. That is perhaps due to it's immaturity.


Genuinely curious: what makes it especially appropriate for gamedev?


The AAA game developers we've talked to are universally in agreement that the lack of garbage collection and the fine-grained control over memory that Rust provides are extremely important for game development.


For sure that'd be useful for AAA dev, but unless the console manufacturers are willing to incorporate it into the official toolchains it's dead in the water.


You'd be very surprised at how resourceful game-developers are at using the tools they prefer. Either way, console manufacturers will add support where there is demand. Certainly you're more likely to see it used first in more limited capacities and on single platform games.

IMO, a much larger stalling block will be Windows platform support. Game Development is one industry where not only is Windows a major platform for games, but the sole, primary development platform of nearly all modern games. All modern console toolchains run exclusively on Windows afaict.


Rust considers Windows a first-class platform. As an example, here's the nightly build page for Windows: http://buildbot.rust-lang.org/builders/nightly-win/builds/79


That's great, but honestly, can it link against MSVC++ generated libs? I've meant to try it out, but kept trying to build rust from scratch, which may be a mistake.


I am not a Windows expert, but generally, it's very hard to link against C++ code. It might need to expose a C interface instead of a C++ one.

I am pretty sure that it's still using mingw rather than VS as well, though eventually, VS support will be important.

> kept trying to build rust from scratch, which may be a mistake.

Yeah, there are binary installers now: http://www.rust-lang.org/install.html


> I am not a Windows expert, but generally, it's very hard to link against C++ code. It might need to expose a C interface instead of a C++ one.

I never said C++ code. I specified the compiler was MSVC++

> I am pretty sure that it's still using mingw rather than VS as well, though eventually, VS support will be important.

That's fundamentally the essence of my question, can MinGW binaries link against MSVC++ generated binaries? If not, then the Windows platform is not really supported well enough to use Rust to seriously develop games with.


Nothing can link against MSVC++ generated libs, at least not the C++ ones. You can link to ones using `extern "C"`, though.


Actually, linkage is the same, it's name mangling that's the problem. Regardless, libs using extern "C" are still build using MSVC++, and that is the question I was asking about.


Console games frequently use alternate languages, for example UnrealScript, Lua, and JavaScript. Of course, these are interpreted instead of compiled, but I'm told that AOT compilation is not a deal-breaker.

I suspect that any integration would be gradual, with some parts written in C++ and some written in Rust. This is the path we're following with Servo, after all.


which parts are mostly written in C++?

And what's the use of python in the code base?

https://github.com/mozilla/servo


It is using a lot of external libraries[1], the major one being the spidermonkey javascript engine.

The Python is used for a pile of code generation, although, AIUI, the Servo team are using more and more Rust macros.

[1]: most of these directories contain submodules pointing to Rust wrappers around other libraries: https://github.com/mozilla/servo/tree/master/src/support

[2]: https://github.com/mozilla/servo/tree/master/src/components/...


Which parts of what? Modern game engines? Nearly all of it, minus often gameplay scripting.

In the hypothetical C++/Rust fusion engine? Whatever hasn't been rewritten yet in Rust, and specifically things that interop with other C++ libraries will remain in C++ for longer times.

Edit: Ohh Servo? Similarly, things that haven't been rewritten yet, specifically javascript interpertation/compiliation. AFAIK Servo is focusing on rewriting layout.


Rust and the PS4 toolchain are both LLVM. So I can see some possibility there. Rust currently runs on it's own patchset now, but the intention is to be fully working with mainline LLVM.


There is currently only one custom patch on top of LLVM[1] and it's just a performance one, not required for semantics.

[1]: https://github.com/rust-lang/llvm/commits/rust-llvm-2014-05-...


Does Rust's patches affect codegen? Hypothetically, if not, you should be able to just feed the IL files into the PS4 toolchain.


As dbaupp said it's only an optimisation. So you should be able to use mainline LLVM now. Therefore using PS4 with Rust wouldn't be too complicated.


Well, it's designed to facilitate a systems language with a powerful type system, but it makes sense that there are some shared concerns with game development.




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

Search: