Open jmdyck opened 5 years ago
Perhaps it'd be good to first step back, and determine what normative impact any definition of "intrinsic" would have?
Oh, probably no impact that anyone would pay attention to.
see related discussion WRT a PR to the Who We Work repository
That link is a 404 for me. (I guess it's a private repo.)
It is.
So could someone with access to that repo summarize (without violating whatever's private about it) how that PR relates to or informs this issue? (Or should I pretend it wasn't mentioned?)
I'll just repost my own last contributions without quotations or names of other people:
Ok, I am satisfied that "intrinsics" should be defined such that includes all the primordials. "intrinsics" also includes the global object, which "primordials" excludes, but that's manageable.
Aside from the global object, does "intrinsics" exclude what "primordials" must exclude: objects provided by the host, like window, document, require, and all objects reachable (only) from them?
For example, if "intrinsic" might be taken to include elements of the "web platform" defined by whatwg/w3c, then we still need the separate term "primordial". If "intrinsic" clearly excludes these, then yes, I think we can drop "primordials" in favor of "intrinsics other than the global object".
"standard intrinsics apart from the global object" is a mouthful. But at this point I agree that some locution involving "intrinsic", if a good one can be found, is better than introducing "primordial" as a seemingly new term.
Nothing particularly "private" there, it's just happened to be an issue attached to the private "How we work" repository.
Here is the essence of my part of the conversation (the preceded Mark's quote):
@erights Yes, All the objects that are created prior to execution of any code in a realm are "intrinsics".
See CreateIntrinsics() in particularly step 13 that says
Set fields of intrinsics with the values listed in Table 7 that have not already been handled above. The field names are the names listed in column one of the table. The value of each field is a new object value fully and recursively populated with property values as defined by the specification of each object in clauses 18-26. ...
The items listed in Table 7 are the Well Known Intrinsics that need to be directly referenced by the specification text. It includes among others all the objects that are specific as values of properties of the global object.
Other objects recursively specified in clauses 18-26 are also intrinsics, but are not "Well known" because there aren't any specification algorithms that need to directly refer to them.
The distinction between "intrinsic objects" and "well known intrinsic objects" probably should be clarified. Basically, the well known intrinics were always intended to be a subset of the intrinsics.
The spec doesn't really define the term "intrinsic".
It does define "well-known intrinsic":
which suggests that "intrinsic" simply means "built-in object".
Alternatively, one could reasonably infer that an intrinsic is any object created by the CreateIntrinsics operation. I believe that all such objects are built-in objects, but the converse is not quite true. That is, the set of objects created by CreateIntrinsics is a subset of the built-in objects (for a given realm). For example, each invocation of MakeArgGetter creates a built-in function object, and that happens outside of CreateIntrinsics.
So: is a function created by MakeArgGetter an intrinsic? My guess is that it isn't, i.e. that the latter inference is the correct one. Not a big deal, but it would be nice to know.
While I'm in the neighborhood, 6.1.7.4 Well-Known Intrinsic Objects says:
I'm dubious about the "usually" and "Unless otherwise specified". Are there any (well-known) intrinsic objects that aren't tied to a specific realm? CreateIntrinsics doesn't seem to think so.