Skip to content

get-buffer-source-{reference,copy} ought to point to the algorithm #229

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

Closed
equalsJeffH opened this issue Nov 7, 2016 · 6 comments
Closed

Comments

@equalsJeffH
Copy link

WebCryptoAPI uses this link -- https://heycam.github.io/webidl/#dfn-get-buffer-source-copy -- (and WebAuthn has been advised to do so also), which points into this WebIDL paragraph:

https://github.com/heycam/webidl/blob/83448a73bec7f84b930fd3b8ef0a8365d5457695/index.bs#L6021-L6027

..although said paragraph actually does not say how one might go about getting said copy (or reference). Subsequent poking through WebIDL yields this algorithm..

https://github.com/heycam/webidl/blob/83448a73bec7f84b930fd3b8ef0a8365d5457695/index.bs#L7945

..which does point back to the former paragraph. It seems to me the paragraph ought to also link to the algorithm.

@domenic
Copy link
Member

domenic commented Nov 7, 2016

This is just an artifact of Web IDL's wonky splint into language-independent concepts ("get a copy of the bytes held by the buffer source") and ECMAScript bindings (the algorithm you found).

It's correct for specs to link to the language-independent concepts. One day we will squish them together, but for now this just parallels the rest of the spec. E.g. the definition of the language independent "double" type doesn't forward-link to the specific way that you might get a double given an ECMAScript environment.

@equalsJeffH
Copy link
Author

Thanks for the explanation, though this asymmetry arguably steepens the WebIDL learning curve -- at least it does so for me.

@domenic
Copy link
Member

domenic commented Nov 7, 2016

Yep, it's a medium-term goal to squash together the language-independent and JS-language-binding sections into one; it's unnecessary abstraction at this point. (Back in the deep past there were Java bindings...)

@tobie
Copy link
Collaborator

tobie commented Nov 7, 2016

Wonder if WebAssembly won't come and ruin that nifty plan, though.

@annevk
Copy link
Member

annevk commented Nov 8, 2016

  1. We should not let WebAssembly guide our design here. Once WebAssembly is ready to integrate with more of the platform, we should at that point see what delta we need to make. We've learned time and again that designing factories fails and actually constrain the solution space.
  2. The real solution to this problem is https://www.w3.org/Bugs/Public/show_bug.cgi?id=28798 which I hope we can get to somewhat soonish (we should, because it soon will be more complicated with buffers shared across threads). The way we deal with bytes at the IDL layer today is rather old-fashioned.

@annevk
Copy link
Member

annevk commented Aug 2, 2021

This was fixed by #987.

@annevk annevk closed this as completed Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants