-
Notifications
You must be signed in to change notification settings - Fork 165
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
Who uses the detach concept for ArrayBuffer? #724
Comments
@tidoust: would reffy be able to find dependencies of a term defined in the WebIDL spec? |
@Ms2ger No, Reffy is coarse-grained here. It does not track references to concepts defined in other specifications. The only thing you can get from Reffy is the list of known specifications that use |
Okay, so I think we should be good removing this from IDL. The one wrangle that remains is how good it is to call ECMAScript abstract operations on what are technically IDL objects, but I think we've largely decided to not care about that for now. |
After the Web IDL rewrite in whatwg/streams#1035, streams would something similar to this: https://whatpr.org/streams/1035.html#transfer-array-buffer and various IsDetachedBuffer checks. I guess it comes down to whether we want people to go through IDL prose, even in the [UnsafeReference] case from https://www.w3.org/Bugs/Public/show_bug.cgi?id=28798, or if Streams, Web Audio, and Web GL should instead down to the ES spec level. |
Also part of this bug: the current sentence
is misleading since they don't really "fail", they just return zero-length byte sequences. If we eliminate the term "detached" then we can eliminate this sentence and clear up the confusion. |
I think we should aim to keep direct JavaScript dependencies to a minimum so we don't have to expand https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md#downstream-dependencies. Keeping JavaScript, IDL, and HTML updated is already enough of a pain as-is. |
I started working on a PR for this and https://www.w3.org/Bugs/Public/show_bug.cgi?id=28798. However, I realized that everyone who wants to deal with detached buffers (namely, Streams) will be using [UnsafeReference] anyway. So we don't need the abstraction layer after all. |
Hmm. Taking over this bug as the continuation of https://www.w3.org/Bugs/Public/show_bug.cgi?id=28798. @annevk, the only non-Web GL user of This impacts whether |
If you're allowing shared memory I think you need to deal with a reference and make copies and such yourself. We might also want to clarify what you have a reference to/copy of. For a copy we could return a byte sequence. But for a reference you need the byte sequence but also the object (or maybe just a way to detach it). |
WebGPU uses the |
That seems fine, but it's problematic that it currently doesn't define define or reference "detach". Also, I think I might come around to IDL providing primitives for this after all, similar to how it does for promises. We just need to be clear that the operation can throw and callers will need to deal with it. |
We should remove https://heycam.github.io/webidl/#dfn-detach, but figuring out dependencies would be good. The main problem with the current prose is that DetachArrayBuffer can throw, as per whatwg/html#4601.
(I suspect at some point it might have been introduced for HTML, which does not use it at the moment.)
The text was updated successfully, but these errors were encountered: