Hacker News new | ask | show | jobs
by hairtuq 2075 days ago
There is some work on automatically generating data structure implementations from high-level specifications: https://cozy.uwplse.org/
1 comments

That's pretty cool. I'm going to have a play, it could be very helpful.

I have implemented some variants of HAMT and it gets pretty frustrating implementing the same algorithms over and over again for sightly different use cases.

In memory, lazy loading and eager nodes serialized to disk with sync and async APIs, the ability to diff between the above. And sets and map versions.

If you had true zero cost abstraction you could build pieces that can be bolted together to achieve all of that quite elegantly. But an attempt in mainstream languages means losing one if not two orders of magnitude of performance.