mattbierner / hamt

Javascript Hash Array Mapped Trie
MIT License
251 stars 16 forks source link

Status of the project #23

Closed rickmed closed 7 years ago

rickmed commented 7 years ago

Hi there! Hamt seems cool! I'm looking for sort of a lightweight immutable-js (data persistent structures of maps/dictionaries and list/collections) so I thought I'd inquire about this project or if you could point me to the right direction.

Thanks!

mattbierner commented 7 years ago

The library is fairly complete at this point—or, at the very least, there aren't really any feature requests coming in. It is in a maintenance mode with foreseeable changes being to improve performance or fix reported bugs, rather than to add extensive new functionality. HAMT will always be a fairly small and targeted library for a single data structure, unlike immutable-js.

Any specific concerns?

rickmed commented 7 years ago

Thank you for the quick reply! Well, for once, the list/collection part (I know hamt does not provide it but maybe you have another project to point me to). Then I'm thinking about functions like map, filter, merge, equals, etc. Not sure if there are already the building blocks for me to implement them efficiently. Also, I don't see functions to convert from/to POJO -> hamt.

mattbierner commented 7 years ago

It sounds like you are after a larger collection library. Immutable or mori are two good ones to try.

Hamt only provides a fairly minimal hash array mapped data structure implementation and API. You can use it directly or wrap the API to provide more advanced functionality. Take a look at this fork that provides transient mutation as well https://github.com/mattbierner/hamt_plus/

Hash array mapped tries have efficient storage with fast updates and fast lookups. They are unordered and are also not the best persistent structure for efficient set operations like merge or intersect or filter. You can implement these, and using transient mutation performance will be ok, but you should find the structure best suited for your use case.