problem-solving
problem-solving copied to clipboard
API reconciliation between Blob/Buf, CArray, and native array
The APIs of Blob/Buf, CArray, and native array overlap, but still have significant differences that aren't obviously related to their different purposes. In fact they seem to be simply accidents of history.
For example, Blob/Buf has both 1- and 2-argument allocate, CArray only has 1-argument allocate, and native array has neither.
We should intentionally decide which API bits should be supported by all (or most) of them, and which are truly unique to the purposes of each. We should then fill in any missing methods of each group, and use the fastest known implementation style for all instances of each common method.
Finally, for cases where it is meaningful to see the same data through a different "API lens", there ought to be both zero-copy and fast single-copy ways to access that data in the other APIs.