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

questions (possible bugs) re specification/language identity #3207

Open
jmdyck opened this issue Oct 24, 2023 · 2 comments · May be fixed by #3217
Open

questions (possible bugs) re specification/language identity #3207

jmdyck opened this issue Oct 24, 2023 · 2 comments · May be fixed by #3217
Labels

Comments

@jmdyck
Copy link
Collaborator

jmdyck commented Oct 24, 2023

In 5.2.7 Identity, paragraph 2 says:

From the perspective of this specification, the word “is” is used to compare two values for equality, as in “If bool is true, then ...”, [...]. The specification identity of values determines the result of these comparisons and is axiomatic in this specification.

But paragraph 5 tells us that Booleans are "without specification identity". So how can specification identity determine the result of a comparison of two Booleans?


Also, paragraph 3 says:

From the perspective of the ECMAScript language, language values are compared for equality using the SameValue abstract operation and the abstract operations it transitively calls. The algorithms of these comparison abstract operations determine language identity of ECMAScript language values.

The latter sentence seems wrong to me. First, the phrase "language identity of ECMAScript language values" is odd, given that paragraph 5 tells us that many ECMAScript language values are without language identity.

So perhaps what the sentence in question means is something more like "[these algorithms] determine whether or not specific ECMAScript language values have language identity". But that isn't true either. E.g., if you look at the Note in SameValueNonNumber, it implies that Null/Undefined/BigInt/String/Boolean aren't "compared by identity", but that's far short of determining that they don't have language identity. Worse, that Note indicates that all Symbols can be compared by identity, implying that that they all have identity, which is true of specification identity but not language identity. (But maybe this is a bug in SameValue.)

Probably the sentence's use of "determine" is the problem. Maybe it should be more like "[these algorithms] rely on the concept of language identity [defined in paragraph 5]."

@bakkot bakkot added the editor call to be discussed in the next editor call label Nov 1, 2023
@bakkot
Copy link
Contributor

bakkot commented Nov 1, 2023

For the first part, we think this can be clarified by replacing the second sentence with

For values with identity, the specification identity of those values determines the result of these comparisons. It is is axiomatic in this specification whether values have identity.

though it may read better to move those around somewhat.

@michaelficarra
Copy link
Member

Our editor call conversation got cut short, but the solution we were working on for the second part is adding "together with the GlobalSymbolRegistry".

The algorithms of these comparison abstract operations together with the GlobalSymbolRegistry determine language identity of ECMAScript language values.

@jmdyck jmdyck linked a pull request Nov 8, 2023 that will close this issue
@michaelficarra michaelficarra removed the editor call to be discussed in the next editor call label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants