|
|
|
|
|
by dystroy
1647 days ago
|
|
You might be confusing mean goal and end goal. Nobody needs to write a linked list, except when interviewing. What you need (a feature, a performance improvement, etc.) is usually better served with other structures, especially in languages which don't heavily favor heap allocations (in a GC based language you've already paid the allocation cost when creating the object anyway). I think there's now some evidence that Rust prevents developers neither from making efficient applications nor from efficiently making them. |
|
There are many linked structures such as an Linked hashmap or LRU cache that can’t be efficiently represented in safe rust. There are engineers who need to code and use such structures outside of an interview context, these engineers must use unsafe to code valid programs.
I honestly wouldn’t mind if the docs were simply upfront on the need to use unsafe and the insufficiency of any alternative for these situations. Long ago it was thought that users would simply use something along the lines of GC<Type> to handle these situations, but none of the rust GC projects materialized.