-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EXPERIMENTAL: map/list interfaces #4
Conversation
Could you elaborate a bit more on the motivation for introducing these types? Particularly what in the existing codebase is lacking that this addresses. Also, regarding methods that return arrays, would it be possible to return iterators instead? There are ADLs where a Map's keys might potentially be too large to store in memory, similarly with Lists. I think we should have streaming in consideration from the get go so that we don't run into issues later. |
Yes, sorry, I should have added more context. This is an attempt to:
Once a reasonable interface is established, it can be extended to other map types/ADLs like HAMT, that are also quite inconvenient to use like normal maps.
Yes, makes sense! I wasn't too thrilled about them and was considering just removing them but returning iterators is much better. Thanks, @RangerMauve! |
Does golang have a concept of async iterators? I think Adin brought it up on the IPFS discord. 😁 |
Good question 😊 I've also been thinking about it since I read Adin's comments. I think it's possible to provide thread-safe, concurrent iteration in the current model, with some tweaks. Can chat a bit about this on the call too, if we have time. |
I also wanted to pass another thought by you, @RangerMauve. I can't get the idea out of my head that what I could easily turn |
Closing in favor of PR against main repo. |
Very experimental changes for (hopefully) more usable
map
andlist
interfaces for IPLD nodes, based on amend.I wanted to get some early feedback so only the
map
interface is implemented. The tests inmap_test.go
demonstrate some ways in which the interface can be used.cc @RangerMauve @rvagg @aschmahmann @BigLep @warpfork