▲ | bakugo 4 days ago | ||||||||||||||||
There's also the fact that a lot of patterns that are commonly used in game development are fundamentally at odds with the borrow checker. | |||||||||||||||||
▲ | simonask 4 days ago | parent [-] | ||||||||||||||||
Basically all of those problems originate with the tradition of conflating pointers and object identity, which is a problem in Rust as soon as you have ambiguous ownership or incongruent access patterns. It's also very often not the best way to identify objects, for many reasons, including performance (spatial locality is a big deal). These problems go away almost completely by simply using `EntityID` and going through `&mut World` for modifications, rather than passing around `EntityPtr`. This pattern gives you a lot of interesting things for free. | |||||||||||||||||
|