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

All intrinsics, or just hidden ones? #21

Open
Tracked by #1
ljharb opened this issue Jun 2, 2023 · 2 comments
Open
Tracked by #1

All intrinsics, or just hidden ones? #21

ljharb opened this issue Jun 2, 2023 · 2 comments

Comments

@ljharb
Copy link
Member

ljharb commented Jun 2, 2023

(if i'm recalling correctly) @syg pointed out that there might be memory issues with holding on to every intrinsic, and asked if this proposal could include only hidden intrinsics.

The upside: we could explicitly list all the hidden intrinsics in the spec, and implementations wouldn't have to keep track of every intrinsic. Additionally, https://npmjs.com/get-intrinsic and SES and test262 would all be able to drop their custom hardcoded ways to reach hidden intrinsics, since they're all now discoverable.

The downside: both https://npmjs.com/get-intrinsic and SES would have to retain their "walk the graph" approach in order to locate all intrinsics.

I strongly prefer that this be all intrinsics - "just hidden" would certainly achieve the SES need of ensuring that hidden intrinsics are no longer undiscoverable, but it wouldn't achieve the ergonomic and API requirements that motivated the proposal in the first place.

@ljharb ljharb mentioned this issue Jun 2, 2023
24 tasks
@mhofman
Copy link
Member

mhofman commented May 16, 2024

An orthogonal question is whether to list all intrinsics or just reachable ones. There are actually 2 subsets in this subtle distinction:

  • Intrinsics that are currently never exposed to user code, and are really more like spec fiction. E.g. %ForInIteratorPrototype%
  • Intrinsics that are optionally exposed to user code, like %SharedArrayBuffer% and derived. The global SharedArrayBuffer is optional and a host may not provide a wasm or similar integration which means there would no alternative way of observing these intrinsics.

I don't believe spec fiction intrinsics should ever be exposed through any means, and I would strongly prefer that it would be permitted to skip otherwise unreachable intrinsics.

(There is also an argument to be made the better term according to the glossary would be primordial instead of intrinsic.)

@ljharb
Copy link
Member Author

ljharb commented May 16, 2024

Absolutely fictional intrinsics would never be included in this list.

Additionally, any intrinsic that isn't otherwise reachable through this proposal would certainly not be included - if SAB is not otherwise exposed in JS as a global, then it wouldn't be exposed here.

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

No branches or pull requests

2 participants