6 ms·
What's interesting is that the Rust community has turned this difficulty on its head: linked-lists are unnecessary, performance killers, and generally evil. (Di
by wahern 8y ago
What's interesting is that the Rust community has turned this difficulty on its head: linked-lists are unnecessary, performance killers, and generally evil. (Ditto for trees.)
That's all true, if you squint really hard, gloss over the equivalencies, discount the additional complexity, and ignore the basic simplifying elegance of linked-lists (particularly the so-called intrusive data structure implementations). But it's dramatically overstated because of a certain defensiveness.
What is absolutely true is that cyclical referencing is the bane of static analysis, and anathema to a language that leans so heavily on its typing system for modeling language semantics. What you think that implies depends on your faith in how far type-based, lifetime-based static analysis can go toward addressing larger issues in the software ecosystem.
- detaro 8y agoYou hear fairly similar statements about linked lists from the C++ crowd too, where they're trivial to implement, so it's unlikely it's just defensive excuses.
- deleted 8y ago[deleted]
- whyever 8y agoThey are are arguably about as trivial to implement in Rust. It becomes tricky when you add constraints: usually you want to avoid unsafe code, but even then you can just implement them on top of a vector and bypass any lifetime/aliasing issues.
- deleted 8y ago[deleted]
- jcelerier 8y ago> linked-lists are unnecessary, performance killers, and generally evil. that's true on any CPU with more than 16kb of cache. linked lists were a good idea at the time of 486, not so much at the time of modern CPUs with 8+ megabytes of L3. See https://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-deque.html https://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vecto...