3 ms·
Regarding values: you can construct the same datastructure in any place, and compare it meaningfully with a datastructure from a completely different source (an
by microcolonel 7y ago
Regarding values: you can construct the same datastructure in any place, and compare it meaningfully with a datastructure from a completely different source (and you can do so efficiently). This is accomplished, as far as I know, by representing almost everything as persistent hash trees (with some implementation voodoo and shortcuts).
Beyond that, you can actually just read the Clojure runtime code. It's a bit messy but there's not really that much there.
- louthy 7y agoPersistent hash tries [1] I have an efficient C# implementation here [2] [1] https://michael.steindorfer.name/publications/phd-thesis-efficient-immutable-collections.pdf https://michael.steindorfer.name/publications/phd-thesis-eff... [2] https://github.com/louthy/language-ext/blob/master/LanguageExt.Core/DataTypes/TrieMap/TrieMap.cs https://github.com/louthy/language-ext/blob/master/LanguageE...
- microcolonel 7y agoI love seeing these datastructures show up in more languages. They completely change the set programs you could feasibly find time to write. Thanks for sharing your C# one, I'll remember that if I ever need to use Unity again. The claims about CHAMP are very impressive, in my experience, Clojure's datastructures perform great for what they do, and they claim CHAMP tends to be many times faster. :- ) > Compressed Hash Array Map Trie Q: “What datastructure would you like?” A: “Yes.”