Replies: 1 comment 1 reply
-
This is true, and may be useful in audio as there are some common denominators between the two problem spaces. But I think the gist of https://github.com/SynthstromAudible/DelugeFirmware/wiki/Codebase-introduction has a lot more to do with shared state management than any kind of code design for handling multiple simultaneous and concurrent inputs in conjunction with other automatons. I feel like Rohan is describing the problem that the Rust programming language attempts to solve, that code which would cause such an issue should be impossible and sorted out prior to compilation. ECS is a great tool for game developers because it allows for a problem to be broken down into small chunks. It does have some downsides, though, and isn't really useful for ensuring that e.g. memory can't be swept out from under you in the middle of executing some function. Perhaps we can apply a tool like Carbon onto this codebase in the future, or maybe reimplement some of it in Rust, to make sure such a thing can't happen. But that's probably far in the future from right now. Since the Deluge Firmware is effectively its own OS, one might look at the Linux kernel's approach to adopting Rust as a model for doing so elsewhere. |
Beta Was this translation helpful? Give feedback.
-
I had a read through the code guide and just wanted to reply to this bit:
I’m actually not sure how fields like game development deal with similar problems, which they must encounter as e.g. a “world” might contain many “levels”, which might also contain many “enemies” - a tree-like structure which the code must have to traverse, like on the Deluge. I tried Googling it, but couldn’t find anything about a standard approach to this. Perhaps the each-object-stores-a-pointer-to-its-parent solution, as I mentioned above, is the norm? If you know, I’d be really interested to know!
The answer for game engines is an entity-component system - in a very loose sense it's composition instead of inheritance, where entities can get assigned components dynamically, and systems can operate on all entities that have their required set of components
Beta Was this translation helpful? Give feedback.
All reactions