Skip to content
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

Normative: Rename integer types to match ECMAScript typed arrays #1030

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Oct 5, 2021

I’ve separated out the integer types rename from #856, as it has greater support and can be done without waiting for parser changes (see also #477).


This renames the integer types to match ECMAScript typed arrays in order to resolve the conflict between the Infra byte and the IDL byte; refs #843 (comment):

(One problem it would resolve is that IDL and Infra conflict on byte. What Infra calls byte IDL currently calls octet.)

Floating‑point types were left for a future PR because it’s not possible to simply rename unrestricted float/unrestricted double to unrestricted float32/unrestricted float64 without the parser being updated first, which is why that depends on something like #857.


I decided to go with int* for signed integers since it’s what ECMAScript typed arrays use, and because ECMAScript provides built‑in support for 32‑bit signed integers using the bitwise OR operator, but none for unsigned integers:

let numInt32 = (num | 0); // Converts `num` to a 32-bit signed integer

ECMAScript Arrays also restrict the length to a positive 32‑bit signed integer.


  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chrome: …
    • Firefox: …
    • Safari: …

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


Preview | Diff


Preview | Diff

@ExE-Boss ExE-Boss force-pushed the normative/rename-integer-types branch from c3318b7 to 791f0a3 Compare October 5, 2021 13:49
@ExE-Boss ExE-Boss marked this pull request as draft October 5, 2021 15:18
@ExE-Boss ExE-Boss force-pushed the normative/rename-integer-types branch from 791f0a3 to e7f7140 Compare October 7, 2021 10:18
@bathos
Copy link
Contributor

bathos commented Oct 8, 2021

Seeing new activity on this, I'm curious if this change is a sure thing - i.e. is this renaming settled and there's just remaining work to do to get everything aligned, or is it still an open question?

(I think these are positive changes - even though I've grown kinda of fond of the quirky old names. My interest stems from maintaining some Web IDL tools that will need to be updated to account for this.)

@domenic
Copy link
Member

domenic commented Oct 8, 2021

I don't believe anyone is pursuing this except @ExE-Boss.

@TimothyGu
Copy link
Member

I think this is a good change if we can pull it off, with regards to the tooling and downstream review impact.

@ExE-Boss ExE-Boss force-pushed the normative/rename-integer-types branch from e7f7140 to cc2c100 Compare October 9, 2021 10:57
@saschanaz
Copy link
Member

saschanaz commented Oct 11, 2021

I also like this since this fits better with modern C++ integer names and most of implementations are in C++ (with an exception of Servo but it also better matches Rust names).

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@ExE-Boss ExE-Boss force-pushed the normative/rename-integer-types branch from 04346ea to d71765b Compare November 9, 2021 05:44
@ExE-Boss ExE-Boss marked this pull request as ready for review November 9, 2021 05:49
@saschanaz
Copy link
Member

Thanks for removing the pseudo IDL blocks but I mean the aliases are probably not needed at all, and parsers can support both in the reasonably short term while @autokagami sends patches. It does depend on how quickly maintainers will respond (and plus, on whether other people here are convinced), though.

@ExE-Boss ExE-Boss force-pushed the normative/rename-integer-types branch from d71765b to a1e472b Compare May 23, 2022 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants