7 ms·
DICE is using it internally. The only reason why they aren't using it in games is because Rust won't compile on console platforms.
by mmstick 10y ago
DICE is using it internally. The only reason why they aren't using it in games is because Rust won't compile on console platforms.
- steveklabnik 10y agoOh? I hadn't heard of this before! I wonder if we can fix that...
- mmstick 10y agoI recall some DICE slides about two years ago and a mentioning from a DICE employee that they are building some of their game dev tools in Rust. Naturally, EA would never approve of allowing DICE to develop a game in Rust if it meant it would make the game PC-exclusive.
- Rusky 10y agoRust can totally compile on console platforms- it's been done, e.g. on PS4 (https://twitter.com/wickerwaka/status/479842553831776257 https://twitter.com/wickerwaka/status/479842553831776257), as I'm sure you've seen, Steve :) The problem (speaking as someone working on a console game at a AAA studio) is more likely that it's not officially supported. Console SDKs include C++ toolchains and C++ libraries, and there's a lot to lose by trying to bypass that, especially on a game project schedule.
- steveklabnik 10y agoYeah, I knew it was possible for some definition of possible; I just didn't know that any game studios were using it in any capacity, let alone a studio like DICE. The support thing makes total sense. Do you think it's fundamentally insurmountable? I'm pretty sure this is an area where the team itself has a blind spot, or maybe rather, just doesn't have the necessary expertise to even know what we'd need to do to make this possible.
- Rusky 10y agoI honestly don't know how fundamental an issue it is. I suspect the console vendors and engine/library developers would all have to be on board at some level. For some idea of the timeline- most consoles transitioned from assembly to C around the N64/PS1 era, and then to C++ around the time it was standardized. A move away from C++ would probably be significantly higher-effort than the move to it- C++ can not only trivially call C APIs but can also compile most C code without modification. To support Rust would require not only porting the toolchain (though this wouldn't be too bad on current-gen, since e.g. the PS4 even uses Clang), but really working well with the console SDKs, and third-party libraries and middleware, which are all written in C++. It would probably also be a much tougher mindshare hill to climb- even C++ took a long time to be accepted, and its standard library still isn't. Vulnerabilities are not really an issue for games the way they are for, say, browsers, since games' inputs and environments are so constrained and there's often no real consequences worse than a player losing their save file. So from my perspective (which to be fair is relatively new to the industry) these might be the most important features for getting Rust into games: * Visual Studio integration, including code completion and debugging. Though console support would have to come from the console vendor, anyone could work on supporting things like variable name hovering and data display. * C++ support- though maybe different from what application developers need. DirectX (Windows/Xbox One) is all COM-based, which is strongly related. If it's handled through bindgen, it still needs code completion support. * SIMD, inline assembly, etc. This stuff gets used all the time for performance, and for a lot of it portability is not a concern, because things are handled differently per-platform anyway. Similarly, Rust might just not be a good fit for games because of some tradeoffs it makes: * Games can't get by with just malloc-style memory management- and while it's easy to mess up, C and C++ handle arenas/pools/etc with far less friction than Rust, where you'd want to package up every little pointer thing behind a safe API. That's a good tradeoff here because the bugs are mostly harmless and easy to track given the constrained environment. * Maybe error handling? (Mostly devil's advocate at this point.) The games I've worked on tend to just assert in debug mode and ignore errors in production. Carefully handling every case could legitimately be a needless time sink for some situations. On the other hand stuff like `unwrap_or` could make that much clearer without slowing anyone down. * I don't agree with all of tomaka's points (e.g. https://www.reddit.com/r/rust/comments/616rc8/rcpp_discusses_rust/dfchodq/ https://www.reddit.com/r/rust/comments/616rc8/rcpp_discusses...) but they would certainly be an issue for many game developers.
- deleted 10y ago[deleted]