Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> stop using references/lifetimes and start using indexes

Aren't arenas a nicer suggestion? https://docs.rs/bumpalo/latest/bumpalo/ https://docs.rs/typed-arena/latest/typed_arena/

Depending on the use case, another pattern that plays very nicely with Rust is the EC part of ECS: https://github.com/Ralith/hecs



Yes, Slab and SlotMap are the next stop on this train, and ECS is the last stop. But a simple Vec can get you surprisingly far. Most small programs never really need to delete anything.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: