-
Notifications
You must be signed in to change notification settings - Fork 13.4k
What do "game developers" want from the Rust runtime? #8668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
IMO - [1.2] I recall an obscure bugs from with virtual memory interacting with runtime libraries creating graphics resources whilst decompression threads were consuming data after asynchronous loads. i think Gl implementations are usually general enough that you wouldn't run into this,but this was with the console customized apis. [2] The rust ideaof lightweight tasks does seem rather useful; [3]
[3.1] Would it be possible to do something like the "leaf-function" idea inspired by how register saving wored on MIPS. [4] dont add exception handling :) rust already gets that right i think. Gamedevs usually use C++ with exceptions disabled. (now, Apologies if i'm rambling or diverging from the original question, the Runtime) [1] the open-world replacement for classes - avoiding the problems of headers&classes in c++. better ability to decouple code whilst using the friendly a.foo(b) syntax with autocomplete and easy chaining. [2] the promise of a language better at (compile-time) reflection (serialization in particular) remembering all the hacks with C x-macros or manually keeping serializes/deserializers/runtime representations in sync, or generating debuug UI's etc. game engines frequently had their own hacks for getting around that and I always looked at c# with envy. [3] the functional 'flavour' (const by default etc) - I became interested in this after experience parallelizing on the xbox360(ILP&SIMD, not just threads); [3.1]Even if you have "enough processing power", parallelizing can reduce latency. [4] the concurrency oriented memory model, seperate heaps per task, seems perfect. As a gamedevelopper i had never liked the idea of multiple threads poking into the same heap. |
is there an expplicit "yield" and/or ability to make a task sleep until woken by a message , that would be nice aswell |
@dobkeratops very valuable feedback, thank you! As for yield, there's actually no implicit yield. It's always explicit, it's just that sometimes the runtime will call the yield function for you: |
Something else r.e. @ptrs: ... consider the use of C++ in conjunction with an embedded language for scripting or application code ; Unity is gaining popularity and that's C++ low-level engine & GC'd C# for the app; (my mythical "perfect langauge" would also have an interpreted subset for rapid iteration.. ) Whenever i see a GC system i always ask for a once-per-frame callable full collect (or call it at other convinient points.. after level load etc..). I'm usually told its sub-optimal compared to fully developped GC systems, but maybe something like that would help early on, and its a hint that could be ignored if you get a superior implementation.. |
@dobkeratops mentioned that Rust should never get exceptions. While I'm not against this idea, I will say that game developers (especially in C++ land) often rely on some way of unwinding when things start going wrong. Of course, for a proper game, a fail!() is simply not going to cut it. Where I work, we use exceptions for this, since it's guaranteed that everything in scope will be destroyed (server connections, In-App-Purchase managerment, file handles, etc). I don't know of such a construct in Rust. |
Catchable exceptions won't be implemented due to the memory safety guarantee. It's just not going to happen. Why isn't |
In the current system I work with, we throw a runtime exception if the If this were Rust, I don't see a good way to guarantee everything is |
i suppose a rust- friendly method could involve spawning tasks and message passing? .. failure shutting down a task.. but that sounds like a completely different architecture to what you describe |
Task failure is just an exception you can only catch at a task boundary. I'm not sure where the problem would be. |
There are no criteria for when this could be closed, so I think it belongs on the mailing list instead. |
…arth Don't lint `iter_with_drain` on references fixes rust-lang#8538 changelog: Don't lint `iter_with_drain` on references
Something that is pretty undefined right now is what the end goal of the Rust runtime's concurrency/parallelism capabilities are. We have Servo as a motivating application, and there is a solid academic background and some web programming expertise around, which is great. But we do not have game development expertise around, and that seems to be a demographic very interested in Rust.
This article was mentioned by "nawfel" in #rust this morning and I think is a great piece to help us figure this sort of thing out. I haven't read the full article, but it describes a concurrency library in use today and gives motivating examples and discusses design decisions. There are also links to more relevant articles.
http://gameangst.com/?p=526
The "actual issue" here in the short term is to start finding sources like this and getting more concrete wants out of the demographic so we can start thinking about them in the context of the Rust runtime.
This is tagged as a metabug, so we can start collecting issues here. Currently there are no issues to link though.
The text was updated successfully, but these errors were encountered: