Follow

How memory-safe programming in Rust can complicate the design of data structures: eli.thegreenplace.net/2021/rus, via news.ycombinator.com/item?id=2 and lobste.rs/s/ydstwh/rust_data_s

Data structures cannot have circular references, so if you need them you can either fall back to non-memory-safe techniques (reference counting or unsafe blocks) or make your top-level structure implement its own memory allocator and refer to everything by indexes into its vector of objects instead of by proper references.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Mathstodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!