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

Editorial: Convert @@ notation to intrinsics notation for well-known Symbols #1314

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Sep 27, 2018

  • this avoids a conceptual conflict with decorators, when they land

Open to bikesheds; other alternatives I considered:

  • explicitly using intrinsics, ie, %SymbolSpecies%, and hardcoding that table, while removing the "well-known symbols table". This felt like it would lose some clarity around intrinsics vs well-known-symbols.
  • Using %Symbol%species% - this would require upstream support in ecmarkup, so i opted not to do it for now.
  • something else?

@gibson042
Copy link
Contributor

Will this interact with special treatment of %% by ecmarkup (e.g., for "%%Internal%%" in specHTML)? And as a meta question, do we want to introduce auto-linking of well-known symbols if we're changing their representation?

@ljharb
Copy link
Member Author

ljharb commented Sep 27, 2018

@gibson042 i would love to see auto-linking of well-known symbols, with or without this change.

I've tested the HTML output locally and atm they don't link anywhere, before or after.

@annevk
Copy link
Member

annevk commented Sep 27, 2018

This would also affect the HTML Standard.

cc @domenic

@ljharb ljharb requested a review from domenic September 27, 2018 17:21
@domenic
Copy link
Member

domenic commented Sep 27, 2018

Happy with whatever. It would be nice cross-SDO citizenship work to make a corresponding HTML Standard PR, but it's certainly not required.

@ljharb
Copy link
Member Author

ljharb commented Sep 27, 2018

@domenic i'm happy to try my hand at that once an approach gets consensus here, prior to merging this one.

@littledan
Copy link
Member

Would it be possible to use a syntax more similar to Symbol.foo, so that it looks more similar to how JavaScript developers refer to the same thing?

@ljharb
Copy link
Member Author

ljharb commented Sep 30, 2018

What’d you have in mind? It would have to be apparent that it’s not a property lookup on %Symbol%, i suspect.

@littledan
Copy link
Member

Sorry, I don't have a concrete suggestion, and agree it shouldn't imply actual property access. But I would prefer that editorial churn like this would somehow inch us closer to being readable by normal programmers. @@ is now understood by a small set of people outside TC39; using a new syntax will make it harder to understand for that see while keeping it unintuitive for the big majority.

@bakkot
Copy link
Contributor

bakkot commented Oct 1, 2018

My preference would be to use the %SymbolSpecies% notation and move the well-known symbols table to immediately following the intrinsics table. That way we reduce the total number of novel syntaxes in the spec. I don't actually think there is much of an important distinction between intrinsics and well-known symbols except for the cross-realm interaction. They're similar enough that it makes sense to put them near each other and use the same syntax, IMO.

@ljharb
Copy link
Member Author

ljharb commented Oct 3, 2018

@bakkot i initially looked at doing that, but it seemed like a loss to remove the useful info in this section.

@bakkot
Copy link
Contributor

bakkot commented Nov 22, 2018

See also #385.

@bakkot
Copy link
Contributor

bakkot commented Nov 22, 2018

figure-2.png also needs to be updated, since it contains the text @@hasInstance.

@ljharb ljharb self-assigned this Nov 23, 2018
@zenparsing
Copy link
Member

I'm thinking that we should leave things the way they are for now, since @@ is well-understood, fairly readable, and used by other specs.

ljharb added a commit to ljharb/ecma262 that referenced this pull request Aug 7, 2019
…c39#1314)

 - this avoids a conceptual conflict with decorators, when they land
ljharb added a commit to ljharb/ecma262 that referenced this pull request Oct 4, 2019
…c39#1314)

 - this avoids a conceptual conflict with decorators, when they land
@bakkot bakkot added the editor call to be discussed in the next editor call label Nov 6, 2019
@michaelficarra
Copy link
Member

Decision from the editor call today was to change @@symbolName notation to %Symbol.symbolName% for consistency with other instrinsics.

@michaelficarra michaelficarra removed the editor call to be discussed in the next editor call label Nov 20, 2019
@ljharb ljharb removed the request for review from bterlson November 20, 2019 23:58
…c39#1314)

 - this avoids a conceptual conflict with decorators, when they land
@ljharb ljharb dismissed jmdyck’s stale review July 1, 2024 19:22

changes addressed

@ljharb ljharb merged commit 3a2efec into tc39:main Jul 1, 2024
7 checks passed
@ljharb ljharb deleted the luke_skywalker branch July 1, 2024 19:40
@Josh-Cena
Copy link
Contributor

@ljharb Out of curiosity: what's up with "luke_skywalker"?

@ljharb
Copy link
Member Author

ljharb commented Jul 1, 2024

@Josh-Cena this PR kills at-at's

@Josh-Cena
Copy link
Contributor

Oh! lmao 😄

domenic pushed a commit to whatwg/html that referenced this pull request Jul 2, 2024
@domenic
Copy link
Member

domenic commented Jul 2, 2024

Just want to drop in with an extra thanks to @ljharb for doing the HTML and Web IDL PRs. That kind of cross-ecosystem citizenship is much appreciated.

domenic pushed a commit to whatwg/webidl that referenced this pull request Jul 2, 2024
linusg added a commit to linusg/ecma402 that referenced this pull request Jul 3, 2024
@linusg
Copy link
Member

linusg commented Jul 3, 2024

PR for ECMA-402: tc39/ecma402#905

linusg added a commit to linusg/ecma402 that referenced this pull request Jul 3, 2024
@ljharb
Copy link
Member Author

ljharb commented Jul 3, 2024

whoops, i should have made that one too. thanks!

gibson042 pushed a commit to tc39/ecma402 that referenced this pull request Jul 11, 2024
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Aug 17, 2024
michaelficarra pushed a commit to jmdyck/ecma262 that referenced this pull request Aug 19, 2024
bakkot added a commit to bakkot/proposal-temporal that referenced this pull request Sep 5, 2024
ptomato pushed a commit to tc39/proposal-temporal that referenced this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.