4 ms·
You are right that cyclic mutable graphs are very hard to model in Rust. But very little code actually looks like that in reality. A lot of code looks like tha
by simonask 7y ago
You are right that cyclic mutable graphs are very hard to model in Rust.
But very little code actually looks like that in reality. A lot of code looks like that by accident.
- brutt 7y agoCyclic mutable graphs are very hard to model in _safe_ Rust (without arena). They can be implemented easily in unsafe Rust, using pointers instead of references, like in C.
- connicpu 7y agoThey can also be implemented by not using pointer spaghetti ;) Even in C++ I generally prefer to use handles over pointers for cases like that because graphs are just plain hard to get right, and if you use handles you can get a nice error message when something goes wrong instead of a segfault.