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

Official name bikeshed #321

Closed
syg opened this issue Jul 15, 2021 · 97 comments
Closed

Official name bikeshed #321

syg opened this issue Jul 15, 2021 · 97 comments

Comments

@syg
Copy link

syg commented Jul 15, 2021

With Realms at Stage 3, let's have an earnest bikeshedding discussion on the name "Realm". We've talked about renaming it many times in the past but AFAICT never had the earnest discussion. The shape of the current proposal has deviated sufficiently from long-standing uses of "Realm" in ecma262 and HTML that a different name seems more appropriate.

At the July TC39, we have consensus that the major JS vendors (browsers + node) will hold off shipping (but not implementing!) until we've bikeshedded.

@ljharb
Copy link
Member

ljharb commented Jul 15, 2021

Of the ones i've heard tossed around so far, "CallableBoundary" seems the most apt.

@Jack-Works
Copy link
Member

Isolate 🤣

@syg
Copy link
Author

syg commented Jul 15, 2021

Isolate

Hard pass. :)

@guybedford
Copy link

I wonder if Membrane makes sense?

@syg
Copy link
Author

syg commented Jul 15, 2021

I wonder if Membrane makes sense?

Also no IMO, because it is not really a membrane in the technical sense. So far I also think CallableBoundary is the most accurate.

@mhofman
Copy link
Member

mhofman commented Jul 15, 2021

CallableBoundary is a bit of a mouthful for a user visible API. It also doesn't capture the fact you get a whole new set of intrinsics and that module instances are not shared.

Context like Isolate is a very overloaded term. I unfortunately don't have any better ideas that come to mind.

@ljharb
Copy link
Member

ljharb commented Jul 15, 2021

a bit of a mouthful for a user visible API

SharedArrayBuffer and FinalizationRegistry would like to have a word with you :-p

@kriskowal
Copy link
Member

Riffing: Intrinsics (new Intrinsics()), ParallelRealm, ThroughTheLookingGlass (LookingGlass, Glass, certainly not Window).

I still like Realm. It fits the bill and the probability of another first-class API appearing that would be a stronger contender for the name is unlikely. It’s far more likely that we’d parameterize the existing Realm constructor for variations on the theme. That there are multiple internal names fit the bill doesn’t condemn the public name, and some of those internal things might be factored differently in the future anyway, as we decompose the notion of a worker/page/agent which consists of a realm (for intrinsics) which consists of a compartment (for module graphs).

@leobalter
Copy link
Member

From all the previous name bikesheds I've seen about Realms, CallableBoundary doesn't seen bad.

If we want something even more accurate I'd say CallableBoundaryRealm would be better, but only in this aspect. CallableBoundary translates well what this API does.

I'm in favor of this name because it's also very specific to this API and this is very helpful for users to search and find related documentation without noise.

The closest concept name I'd think would be an Acrylic Glove Box, and I hoped for it to have a specific single name, maybe in German.

I'd like to register one of the concerns for this name is the confusion of other things sharing the name in the HTML spec reality. This creates confusion there and implementation. @syg might correct me if I said anything wrong. IMO, this is a compelling argument and I'm fine with a distinct name.

I'll have a PR-draft open to make sure I capture all the parts that would need to be renamed. Maybe seeing it from a rendered spec would make it easier to digest.

@kriskowal
Copy link
Member

The closest concept name I'd think would be an Acrylic Glove Box, and I hoped for it to have a specific single name, maybe in German.

You win this round @leobalter. Do we camel case with a hump for every composite of a compound German word likeAcrylHandSchuhFach?

@Jack-Works
Copy link
Member

IsolateRealm?

@ljharb
Copy link
Member

ljharb commented Jul 16, 2021

I still think using "isolate" as a noun, instead of a verb, is very weird.

@Jack-Works
Copy link
Member

I still think using "isolate" as a noun, instead of a verb, is very weird.

Then IsolatedRealm

@leobalter
Copy link
Member

I believe Isolated or any derivation won't be successful as some delegates don't see this API as full isolation set.

The problem for the naming here is that every name we pick will have objections against.

I'm not kidding that we need to pick the least offensive name.

@caridy
Copy link
Collaborator

caridy commented Jul 16, 2021

The prior art is "Context", which is available in node, jscore/ios and v8/android. Creating a new Context(), or new CallableContext() reads well IMO.

@ljharb
Copy link
Member

ljharb commented Jul 16, 2021

"Context" is way too overloaded a term (think scope) - i'm pretty strongly opposed to that.

@Jamesernator
Copy link

Jamesernator commented Jul 16, 2021

My feeling is that names like CallableBoundary doesn't desribe the core functionality of a new "Realm" which is a set of intrinsics/builtin/global. The callable boundary aspect is more of an interface.

Perhaps something like GlobalScope/GlobalEnvironment/FreshBuiltins, admittedly I like none of these extra words like Scope/Environment/Fresh but perhaps there's a more fitting word.

This kind of naming makes more sense with the methods, e.g. globalEnvironment.evaluate(script) can be read as evaluate the script script in the global environment globalEnvironment. (Names like CallableBoundary don't make as much sense, e.g. you wouldn't evaluate a script IN a "callable boundary", the boundary is only the thing that separates the global scopes).

@ljharb
Copy link
Member

ljharb commented Jul 16, 2021

Since it doesn't provide an actual global object/globalThis, or a container of intrinsics/builtins/etc, then the name shouldn't imply that.

@Jamesernator
Copy link

Since it doesn't provide an actual global object/globalThis, or a container of intrinsics/builtins/etc, then the name shouldn't imply that.

But that's exactly what it does, it's just that you can't interact with it except through the evaluate/import methods. The fact the global scope isn't directly accessible doesn't mean it isn't there. And in fact, with a membrane you can almost directly interact with it as if they were just another set of intrinsics.

@Jack-Works
Copy link
Member

Maybe Realm is good enough

@ljharb
Copy link
Member

ljharb commented Jul 16, 2021

Sure, but this isn’t a membrane, and this thing isn’t actually the thing you’re interacting with - it’s still just a screen even if i can use it to remotely view and interact with another place :-)

@erights
Copy link
Collaborator

erights commented Jul 16, 2021

I agree with @Jack-Works that just Realm is fine. It's not like the current exposed realms of iframes or vm.createContext are already widely known as realms, so I don't think calling this new thing Realm would be confusing.

@ljharb
Copy link
Member

ljharb commented Jul 16, 2021

@erights https://github.com/search?q=cross-realm seems relatively widely used as a justification for use of Array.isArray, among other things.

@caridy
Copy link
Collaborator

caridy commented Jul 16, 2021

CallableRealm?

@leobalter
Copy link
Member

@caridy please no! Because the constructor throws a TypeError if new target is undefined makes me not want to call it CallableRealm.

@bathos
Copy link
Contributor

bathos commented Jul 17, 2021

Since it doesn't provide an actual global object/globalThis, or a container of intrinsics/builtins/etc, then the name shouldn't imply that.

Agreed, please don't call it "intrinsics" given some of us are still hopeful that a future proposal will provide what we were hoping this one would (fresh intrinsics).

@victornpb
Copy link

victornpb commented Jul 19, 2021

Here’s some alternative names, in no particular order:

  • new Container()
  • new Bubble()
  • new Land()
  • new Arena()
  • new Canister()
  • new Crate()
  • new Jar()
  • new Bowl()
  • new Capsule()
  • new Vase()

I particularly like Realm but something like Land seems pretty close to the original but being different at the same time.

@mhofman
Copy link
Member

mhofman commented Jul 19, 2021

I actually like Bubble. It's a sphere with a boundary isolating the inside and outside. And lexically it fits nicely between Agent and Compartment.

@erights
Copy link
Collaborator

erights commented Jul 19, 2021

Yay Bubble !

Btw, the thing the spec calls "Agent" I hope we never expose in an API with the name "Agent". This would be the worst terminology choice of all. So I discount the lexical argument for Bubble ;) . I like it anyway.

@erights
Copy link
Collaborator

erights commented Jul 19, 2021

Here’s some alternative names, in no particular order:

  • new Container()

Too similar to Compartment. With both in the language, will people naturally remember which is which? Is it more natural that multiple containers fit in a compartment or that multiple compartments fit into a container?

  • new Bubble()

Memorably different and enjoyably playful. But does it make any metaphorical sense to have multiple compartments inside each bubble?

  • new Land()

I just don't like it. Since I don't know why I don't, I cannot know I would not get used to it. But I don't like it.

  • new Arena()

Interesting. Would like to hear more.

  • new Canister()

Same reaction as with Container. People won't remember which is the canister and which the compartment unless there's a least a good metaphor to explain which goes into which.

  • new Crate()

Fatal Rust conflict

  • new Jar()

Fatal Java conflict

  • new Bowl()

Interesting. Would like to hear more.

  • new Capsule()

Interesting. Would like to hear more.

  • new Vase()

Interesting. Would like to hear more.

@chris-kruining
Copy link

ShadowRealm anyone?

maybe this could be intuitive to use if you are familiar with shadowDOM

@kriskowal
Copy link
Member

SatelliteRealm satisfies my earlier thoughts about creating a system of names where at least part of the name indicates how related features of the language nest. I’ve suggested that the word Globe or Global both highlights the distinguishing feature of compartments (each has a unique global object) and also a basis for an astronomical metaphor for how they nest: a globe (née compartment); a globe and its satellites (née realm); a system of stars, planets, and satellites (née agent or worker), a cluster of stars (née agent cluster).

  • GlobalRealm
  • SatelliteRealm
  • SystemRealm
  • ClusterRealm

@ljharb

This comment has been minimized.

@leobalter

This comment has been minimized.

@leobalter
Copy link
Member

@ljharb I had internal convos a while ago about IsolatedRealm and got feedback about it not being a good enough name. I can't remember the details, maybe @caridy does?

@chris-kruining @jdalton I like ShadowRealm conceptually looks like Shadow DOM, but they differ so much in how the API works and connects things.

Shadow* has the precedent in the web, so I'm keeping ShadowRealm in my list.

@kriskowal's comment supports my thoughts for SatelliteRealm, compared to ShadowRealm it lacks the precedent, but the distinction might be good here.

I now believe these names are better than CallableBoundary, so I'm dropping it from my personal list.

I'm also dropping support for Bubble for the reasons well illustrated by @othermaciej here, although, Realm still feels like good enough for me if we don't find an alternative.

Here is the list with no preference order:

  • Realm
  • SatelliteRealm
  • ShadowRealm

I intend to present this at the upcoming TC39 meeting.

@domenic
Copy link
Member

domenic commented Aug 23, 2021

Thanks for the work here @leobalter and others.

One thing to note is that regardless of the developer-facing name, we almost certainly need a distinct specification name for these sorts of realms. There's much less pressure on that choice since the only cost to it being awkward or changing in the future is to specification people. But I suspect be important for web platform integration work.

To give an example, if you chose Realm for the API, we could use something like "Realm-constructor-created Realms" in specs.

(Personally I'm still rooting for Bubble, but smart people disagree with me 😉.)

@caridy
Copy link
Collaborator

caridy commented Aug 23, 2021

(Personally I'm still rooting for Bubble, but smart people disagree with me 😉.)

I feel the same. Bubble is my preferred choice. I don't believe @othermaciej's point is fatal, for experts or novices, a name that is easy to remember will always win.

@leobalter
Copy link
Member

Thanks, @domenic. I wonder if you have any concern about SatelliteRealm so I can bring this forward to the plenary.

I understand Bubble is preferred (echoed by @caridy), but I believe both of these names enable the same functionality that is not possible by the "Realm-constructor-created Realms" counter argument.

From one aspect, SatelliteRealm makes is much easier to search on the web what this constructor is about. Bubble is better than Realm itself, IMO it might mislead to other very distinct concepts such as event bubbles or bubble sorting.

@leobalter
Copy link
Member

To make it clear, I'm pulling back Bubble and re-adding it to the discussion for the reasons above.

@domenic
Copy link
Member

domenic commented Aug 23, 2021

No concerns about SatelliteRealm.

@jridgewell
Copy link
Member

I don't see "foreign" mentioned anywhere here, we could try ForeignRealm.

@ljharb
Copy link
Member

ljharb commented Aug 23, 2021

I dont think qualifiers of “satellite” or “foreign” really explain what the difference is :-/

@bathos
Copy link
Contributor

bathos commented Aug 24, 2021

I’ve used the term "foreign realm" to refer to “any realm that isn’t the local realm” for a long time, but I’m not sure if that’s common or if that’s just me? In particular it suggests “surprise” realms — e.g. “be mindful that instanceof results may be counterintuitive for objects from foreign realms”. If others share this interpretation, it probably isn’t a suitable qualifier for this.

@Jack-Works
Copy link
Member

foreign object and exotic object might be confusing 👀

@syg
Copy link
Author

syg commented Sep 1, 2021

TC39 has reached consensus on ShadowRealm, so closing this thread.

See you all there.

@syg syg closed this as completed Sep 1, 2021
@oldmud0
Copy link

oldmud0 commented Oct 10, 2021

Pardon for speaking out of line, but is the committee aware that "shadow realm" is the name of a popular meme? I was quite surprised that there was no reference to this fact anywhere in the proposal.

@erights
Copy link
Collaborator

erights commented Oct 10, 2021

Wow. I, for one, had no idea. Thanks.

@ljharb
Copy link
Member

ljharb commented Oct 10, 2021

It was discussed in our matrix channel during the plenary item; those familiar with the meme felt it was apropos (not that the meme had anything to do with the naming).

@Jack-Works
Copy link
Member

image

This one? Looks horrifying 😂

@bathos
Copy link
Contributor

bathos commented Oct 11, 2021

It's a colorful English "stock phrase" for mysterious secondary realities which has been used in poetry, fantasy novels, etc for a lot longer than Yu-Gi-Oh or a specific meme based on it have existed.

@leobalter
Copy link
Member

I knew it had references from Yu Gi Oh and Zelda. Trying to keep the professionalism and not sabotage this bikeshed, I avoided knowing the references while confirming with people the references don't have issues such as - but not limited to - hate speech or violence.

jjgriego added a commit to jjgriego/compat-table that referenced this issue Apr 25, 2022
ShadowRealm is the new name for the old Realms proposal [1][2], and the API is
simplified; I adjusted the test code accordingly.

[1] https://github.com/tc39/proposal-shadowrealm (note that the old URI redirects here, too)
[2] Renaming discussion here: tc39/proposal-shadowrealm#321
jjgriego added a commit to jjgriego/compat-table that referenced this issue Apr 25, 2022
ShadowRealm is the new name for the old Realms proposal [1][2], and the API is
simplified; I adjusted the test code accordingly.

[1] https://github.com/tc39/proposal-shadowrealm (note that the old URI redirects here, too)
[2] Renaming discussion here: tc39/proposal-shadowrealm#321
ljharb pushed a commit to jjgriego/compat-table that referenced this issue Oct 19, 2022
ShadowRealm is the new name for the old Realms proposal [1][2], and the API is
simplified; I adjusted the test code accordingly.

[1] https://github.com/tc39/proposal-shadowrealm (note that the old URI redirects here, too)
[2] Renaming discussion here: tc39/proposal-shadowrealm#321
JLHwung pushed a commit to JLHwung/compat-table that referenced this issue Mar 30, 2023
ShadowRealm is the new name for the old Realms proposal [1][2], and the API is
simplified; I adjusted the test code accordingly.

[1] https://github.com/tc39/proposal-shadowrealm (note that the old URI redirects here, too)
[2] Renaming discussion here: tc39/proposal-shadowrealm#321
@GrantGryczan
Copy link

To add onto the last few comments, I'll note that I found the name "shadow realm" very funny, and if I were developing using this I would not be able to stop thinking about its colloquial meaning every time I use it. I don't necessarily see this as a bad thing though, haha.

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