3 ms·
You don't need unsafe. This point is brought up a lot, though I understand where the misunderstanding can come from. Rust is perfectly capable of expressing gr
by PudgePacket 7y ago
You don't need unsafe. This point is brought up a lot, though I understand where the misunderstanding can come from.
Rust is perfectly capable of expressing graphs with zero unsafe code, just currently not in the most optimum implementation.
- ClumsyPilot 7y agoIs is fine, or suboptimal to the point of being impractical? Genuine question, how bad is this, if quanified?
- sanxiyn 7y agoIt is fine and practical.
- staticassertion 7y agoAdjacency matrices are trivial to implement in Rust. I leverage graphs constantly.
- tick_tock_tick 7y agoIt's slow.
- pornel 7y agoYou need to use reference counting or a scoped memory pool. It's totally fine in almost all cases. Refcounting in Rust is still faster than refcounting in ObjC or Swift (because Rust can avoid using atomics or increasing counts in many cases), but people who use Rust tend to insist on zero overhead, and a truly flexible zero-overhead solution can't be verified statically.
- Rusky 7y agoYou don't even need "not the most optimum implementation" (assuming you're talking about index-based graphs or something). You can make non-leaking pointer-based graphs in safe Rust using reference counting (basically what C# does, if you squint) or arenas (if your nodes' lifetimes fit that pattern).