whatwg / webidl

Web IDL Standard
https://webidl.spec.whatwg.org/
Other
410 stars 164 forks source link

Add Float16Array #1398

Closed bakkot closed 7 months ago

bakkot commented 7 months ago

The Float16Array proposal for JavaScript adds a new TypedArray type holding IEEE binary16 floats. This PR adds it to all of the lists of TypedArray types in WebIDL.

Implementations of the proposal are underway in at least Chrome and Firefox, though it'll be some time before they're shippable. I don't know what the appropriate time to merge this is but I figured I should at least open it.

This is a JS feature, but adding it to ArrayBufferView has implications for any API which takes a generic TypedArray, which is quite a few of them. Does that imply they all need new tests? Hopefully not?

Fixes https://github.com/whatwg/webidl/issues/1310.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

bakkot commented 7 months ago

OK, opened a PR with tests.

annevk commented 7 months ago

Thanks @bakkot, I think the one thing remaining is that we should probably link the proposal if we are to merge this. Similar to how HTML has "[JSIMPORTATTRIBUTES]" and such. With that nit addressed I'd be willing to merge this Friday, barring any other feedback.

bakkot commented 7 months ago

I stuck a link to the proposal in the table which defines the types, but I'm not sure that's the best way to do it. Happy to take suggestions for alternative ways to include the link.

annevk commented 7 months ago

I think the placement is good, but you want to use something akin to https://github.com/whatwg/fetch/blob/4c3750d3277e3df5ad452f48314eb29ca43b6461/fetch.bs#L58-L115 to add an official looking reference which you'd then reference from there.

bakkot commented 7 months ago

Neat, done.