3 ms·
This is true, but also a false dilemma. Rust provides an escape hatch in the form of the `unsafe` keyword. This allows the implementation of efficient data stru
by necubi 12y ago
This is true, but also a false dilemma. Rust provides an escape hatch in the form of the `unsafe` keyword. This allows the implementation of efficient data structures, while still providing static safety guarantees to the vast majority of code.
- pron 12y agoWell, GC runtimes also ensure memory safety of those data structures (you can't really implement them too efficiently without a GC anyway) without being unsafe, while Rust provides neither memory nor race safety in these interesting cases. Still, I think Rust design decisions are correct if it wants to fill the C/C++ niche (which I hope it will). That niche is not necessarily meant to provide the best performance (I believe JITs will soon surpass any AOT compiler, and GCs are pretty much a must to support concurrent workloads on many-core servers with huge RAM) but safety and speed in constrained environments or applications where GC/JITs are inappropriate (small RAM/short startup). But even so, there is a need for good concurrent data stuctures. What I'm wondering is whether Rust provides a way to use the type system alongside concurrent data structures (ARCs don't cut it). Is there a way to say "this pointer is managed by a transactional data structure and can be shared freely among threads"?