Open Stebalien opened 3 years ago
I fully agree - see https://github.com/ipld/go-ipld-adl-hamt/issues/17. The API in this ADL is by no means done, and there's more work to do here before it is useful.
Ok, that makes me much happier. But I'm also including things like:
node := builder.Build().(*hamt.Node)
nodeRepr := node.Substrate().(hamt.HashMapNode).Representation()
That kind of code is completely opaque.
Feel free to close this issue if you consider this covered.
With https://github.com/filecoin-project/go-hamt-ipld/, I can easily:
This is how a map should work.
With this library, I'm not even sure how I can load a HAMT (no tests cover opening an existing HAMT). After that, it looks like I need to build key/values and perform a bunch of magical type-assertions to actually do anything. There's no simple Put/Get/Delete API that I'd expect on any reasonable map type.
I appreciate having a low-level API for hyper-efficient auto-generated code, but there needs to be an API that's usable by humans. One that doesn't require writing 20 lines of code where 5 should suffice and one that doesn't include any type assertions. I mean, this is the "basic" Filecoin test: