Hacker News new | past | comments | ask | show | jobs | submit login

How often do you really need those interesting structures(and the memory fragmentation that comes with them)? I've seen countless times where a developer reached for std::hash_map/linked_list when there will never be more than 10 values in their dataset. In that case an array would be at least as fast and much easier on your data layout.

Also if you're trying to implement lockfree data structures then safe/unsafe pointer access are going to be the least of your worries :).




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.


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




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: