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

Naming conflict with WebIDL's record<K, V> #116

Open
hober opened this issue May 7, 2020 · 9 comments
Open

Naming conflict with WebIDL's record<K, V> #116

hober opened this issue May 7, 2020 · 9 comments

Comments

@hober
Copy link

hober commented May 7, 2020

WebIDL has had record types for a number of years now—see 2.13.28. Record types — record<K, V> for the definition—and it's pretty confusing that the Record type in your proposal is so different from it. The web platform should be consistent in its use of the term.

This is related to, but distinct from, issues #82 and #96.

See also whatwg/webidl#881.

@ljharb
Copy link
Member

ljharb commented May 7, 2020

I don't think we should constrain the naming of runtime types based on purely editorial names in a specification; if it's confusing, and Record is the best name for this proposal, then it might be advisable at that time for WebIDL to rename its record type.

@littledan
Copy link
Member

littledan commented May 8, 2020

Thanks for raising this, @hober . It's important that we think these interactions through.

In #96, there seems to be agreement among the TC39 delegates who commented that, while it would be a lot of work, it may be the best tradeoff to rename the ECMA262-internal "record" concept to something else, especially since it's not available to JS code.

Do you think such a similar tradeoff would be viable in WebIDL terminology as well, to be open to changing the name of WebIDL records, given that, from a JS developer's perspective, WebIDL records might be considered "just objects"? I'm encouraged by other transitions in WebIDL notation that have successfully landed over the past few years.

@hober
Copy link
Author

hober commented May 8, 2020

Do you think such a similar tradeoff would be viable in WebIDL terminology as well, to be open to changing the name of WebIDL records[?]

Maybe. That's why I filed whatwg/webidl#881 too.

@rricard
Copy link
Member

rricard commented May 28, 2020

We are going to try to solve this issue before stage 3, that means either finding out if we can change WebIDL terminology or finding another name for this proposal (see #116).
Additionally we just opened a TAG review for that proposal and mentioned that concern there: w3ctag/design-reviews#518

@rricard
Copy link
Member

rricard commented Jul 8, 2022

Per #82 we are going to keep Record & Tuple. We intend to disambiguate in the ECMA262 spec by explicitly referring to "Record Primitive" as we discussed in #96 (comment). Do you think something similar could be done in WebIDL?

@ljharb
Copy link
Member

ljharb commented Jul 8, 2022

I think a better bet for both specs is to change their Record concept to something else, since Record alone will now mean the primitive in every other JS context.

@rricard rricard mentioned this issue Jul 25, 2022
25 tasks
@bathos
Copy link
Contributor

bathos commented Oct 28, 2022

While I think it would be great for Web IDL to change the type name, it may be worth noting that Web IDL already has the potential to confuse people about things like this many times over if, for example, a reader expects Promise<T> values to be Promises (they’re PromiseCapabilities) or Web IDL’s ArrayBuffer type to be 1:1 with values that would pass ES ArrayBuffer’s brand checks (it can be a superset or a subset of them depending on its annotations). String types aren’t primitive in Web IDL; the bigint Web IDL type isn’t numeric; etc. Not saying it shouldn’t be updated, but it probably shouldn’t be blocking...

@rricard
Copy link
Member

rricard commented Oct 28, 2022

I agree, when opening whatwg/webidl#1184 (that I need to finish working on the feedback...), we figured that there is not a major ambiguity between WebIDL Records and ECMAScript Records, at least as long as we contain ECMAScript Records in the ECMAScript interaction section...

It has been moved to a Stage 4 concern for the time being as it should still be solved down the line...

@ljharb
Copy link
Member

ljharb commented Oct 28, 2022

Since spec authors are always the bottom run of the priority of constituencies, spec names conflicting with runtime names must never be a blocking conflict, in HTML (i presume, lest they violate their own priorities) or JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants