|
|
|
|
|
by Panzerschrek
18 days ago
|
|
Is it memory safe? Can I cause use-after free, double-free, out-of-bounds access errors or something similar? What about race conditions? In your DCMP examples you demonstrate how types can be composed from smaller components. How does it work under the hood? Is it possible to create an abstract container for Legs and store inside it any object having this component? |
|
Race conditions should be prevented by design, but I haven't actually implemented multithreading at all yet, so I would rather not make any statements about it since it's not done.
I also posted the language on reddit and got quite a lot of feedback from it, and now I am redesigning many parts of it since it was a bit messy (static guarantees, that it basically has nothing to do with ECS any more etc).
I don't know what you exactly mean with an "abstract container". But yes the data `Legs` can be used across many different entity types, you can use and store that component in every entity type you would want to.
Under the hood it essentially is just owned composition, so the entity is just a tuple of pointers to its owned data components, nothing more.