Bevy's immutable components: managing side effects in a parallel world
summary
Bevy adds immutable components as a metadata flag that blocks get_mut but still allows removal and reinsertion, which intentionally triggers lifecycle hooks to run immediate world-mutating code. That loophole converts a compile-time restriction into a reliable push-based enforcement mechanism used to implement working relations (doubly linked entity lists) and centralized indexes; relations and indexes are built and validated at insertion/removal and they work, trading higher runtime cost for zero-frame-invariant violations versus slower pull-based change detection.
AI-written summary · about
chapters (24)
- 0:00Intro
- 0:55What is Bevy
- 4:23Who uses Bevy
- 4:38Why this talk
- 5:35What is an ECS
- 6:33Components
- 7:27Getter setter pattern
- 8:45Component trait
- 9:31Component mutability
- 10:48Mutability
- 11:55Life cycle hooks
- 13:18Change detection
- 14:26Why do we need both
- 15:33The core problem
- 16:02Pullbased mechanisms
- 17:08Implement relations
- 18:26Summary
- 19:42Support the ecosystem
- 19:57Questions
- 20:22Game studio
- 21:26Tiny Glade
- 22:41Whats next
- 23:30Flex
- 25:13ECS Dev
related talks
15mNon-binary Rust: Between Safe and Unsafe
31mImmutable Data Structures and why You want them
01h 03mThe most valuable values
07mThe Tragedy of the value based architecture
23mA Verified Thread-Safe Array in Rust
54mKEYNOTE: A journey through incremental computation
19mPure Borrow: Linear Haskell Meets Rust-Style Borrowing
59mFunctional Programming: data
