-
Notifications
You must be signed in to change notification settings - Fork 108
Conversation
One thing I wanted to draw attention to is the section at the bottom "Flexible head for efficient operations at the head and for sub-trees". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, great write-up!
On the topic of iterative vs recursive processes: I've started off implementing operations both here and in HashMap as recursive because it feels more appropriate. However I'm migrating toward iterative approaches in order to make these algorithms more atomic, where each step is a discrete thing that operates on a block that has only just the right amount of state. In js-composites it's only possible to do it this way, the logic gets invoked per block, so https://github.com/ipld/js-composites/pull/5/files#diff-1a52ff098f2bcf415524a4220e8d61feR20 is a single block/node traversal of a Vector. That one's nice because we can traverse a single block as if it's the only traversal, just adjusting the Forcing this design style has a benefit of getting us theoretically closer to WASM implementations of these algorithms. Execute individual steps, maintain a certain amount of state. In iavector, I've tried to do most of it this way, even calculating Mutations are more awkward and I've started down the road of doing them this way but the state management quickly gets out of hand and I haven't come up with a nice API for it yet. I'm sure there is one but I haven't had time to iterate on the design enough. |
This is now merged, but it's: Status: Prescriptive - Draft |
Expected Consensus Update
I've not yet included algorithm details for operations I don't yet support in https://github.com/rvagg/iavector, but I don't want those to be a blocker for making progress on getting this merged, they could come later. The current operations are the most useful for putting this thing to work at the moment.