Re:Rust Sucks If I Fail to Write X
by charles-salvia on Friday February 17, 2017 @02:09PM
(#13670837)
When you need them you really need them. A Patricia Trie for example, which includes back pointers to ancestor nodes, is simply an ideal structure for prefix search.
Re:Rust Sucks If I Fail to Write X
by Manishearth on Friday February 17, 2017 @02:41PM
(#13671067)
How about a rephrasing: how many times do you really need to write these?
Rust will make it tricky to implement these, but then you can use the datastructure safely as much as you want. It's a "write once use everywhere" thing.
Usually there's no good library that fits your use case. There's always subtle differences (to quote John Carmack)
Or it's really hard to find the good one amongst a hundred bad ones (to paraphrase ESR, when he tried Rust in all seriousness).
"Write once use everywhere" is wishful thinking, it's important to make adaptions (to paraphrase Knuth).
Check out qp tries http://dotat.at/prog/qp for something rather more compact than Patricia tries
Also if you're trying to implement lockfree data structures then safe/unsafe pointer access are going to be the least of your worries :).