Re: [whatwg/streams] Brainstorming a buffer-reusing version of writable streams (#495)

> There was talk of "partially" detaching ArrayBuffers, so that a WebAssembly program could pass off a chunk of its backing storage to a Stream while keeping the rest. If this was implemented it would also be useful for the grep case you are talking about.
>
> If I understand correctly, there are several other use-cases for partially-detaching ArrayBuffers, so maybe it's not as crazy as it sounds.

In general I am a big fan of this concept, but the web standards community has kind of coalesced around SharedArrayBuffers instead, with the idea being that you can build abstractions around them to emulate semantics like partially-detached ABs. An old example is https://gist.github.com/dherman/5463054 by @dherman although I guess that is more a usage sketch without an implementation. (Source blog post: https://blog.mozilla.org/javascript/2015/02/26/the-path-to-parallel-javascript/)

I think an interesting step will be a modification of readable BYOB streams to use SharedArrayBuffers and in particular to avoid the detach-dance, since with SABs we're allowing data races anyway so all the transferring work we do to avoid them is not necessary.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/495#issuecomment-284083329

Received on Friday, 3 March 2017 22:07:03 UTC