René's URL Explorer Experiment


Title: Challenges with ES6 symbols · Issue #2012 · microsoft/TypeScript · GitHub

Open Graph Title: Challenges with ES6 symbols · Issue #2012 · microsoft/TypeScript

X Title: Challenges with ES6 symbols · Issue #2012 · microsoft/TypeScript

Description: I'd like to outline some of the thoughts the team has had about supporting custom ES6 symbols. This is focused on the proposals we have come up with, as well as the challenges associated with them. The motivation is something like this: ...

Open Graph Description: I'd like to outline some of the thoughts the team has had about supporting custom ES6 symbols. This is focused on the proposals we have come up with, as well as the challenges associated with them....

X Description: I'd like to outline some of the thoughts the team has had about supporting custom ES6 symbols. This is focused on the proposals we have come up with, as well as the challenges associated with t...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/2012

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Challenges with ES6 symbols","articleBody":"I'd like to outline some of the thoughts the team has had about supporting custom ES6 symbols. This is focused on the proposals we have come up with, as well as the challenges associated with them.\n\nThe motivation is something like this:\n\n``` ts\nvar s = Symbol('hello');\nvar obj = {\n   [s]: \"\"\n};\nobj[s]; // gives type string\n```\n\nWe have had two genres of proposal here, the entity approach and the type approach.\n1. Entity approach: Use the compiler's entities as an approximation for the symbol value. In the above example, we would say that the variable `s` is the entity that the property key `[s]` represents. Any key referring to `s` is the same key, and any other way of referring to the value of `Symbol('hello')` is different.\n2. Type approach: Creating a symbol manufactures a type that uniquely represents that symbol value. This would involve introducing a new kind of type constructor. It is potentially far more complex than the entity approach, but in principle it would be more accurate.\n\nThere are 4 general challenges with these approaches:\n1. Symbol aliasing: If you have two variables pointing at the same symbol, you want them to be the same. This is a drawback for the entity approach, but the type approach gets this right.\n2. Symbol reassignment: If you have one variable that gets assigned two different symbols at different times, you want them to be different. This is a drawback for both approaches.\n3. Solidifying symbol types: If there is a way to specify that something manufactures a new symbol type, there must also be a mechanism for what happens when the symbol gets assigned to something (solidified). Drawback for the type approach.\n4. The compiler is architected so that the properties of a type must be determined before analyzing relationships among types. With symbols, figuring out what properties a type has might require analyzing complex relationships among types. This can lead to circularities. This is a drawback for both approaches, but is more severe for the type approach, and the severity tends to increase the more general the feature support is.\n\nIssues 1, 2, and 3 are really just specific cases of a more general problem. Namely, there is no 1-to-1 correspondence between static entities in the code (declarations, expressions) and runtime values. And because symbol identity is based on runtime values, there needs to be a 1-to-1 correspondence with static entities.\n\nI think the best antidote for these issues is to limit the support for symbol properties to situations where we know there is a 1-to-1 correspondence between values and static entities. There are two general approaches we can explore, which share this 1-to-1 philosophy. They both use the entity approach mentioned above as a base:\n1. Support symbols exactly as a user would write them in ES6. This involves identifying usages where this 1-to-1 correspondence would hold, and only supporting symbols in those contexts. For instance, we might give special preference to const declarations, or disallow using symbols inside a loop or across a function boundary.\n2. Add TypeScript syntax (perhaps a new kind of declaration), for which we enforce/ensure that the correspondence is 1-to-1, and recommend that users use symbols in the way prescribed by TypeScript with these new forms.\n\nObviously, neither of these are complete proposals, but this is intended to start a discussion directed at finding a solution that is both feasible and would satisfy users' needs.\n","author":{"url":"https://github.com/JsonFreeman","@type":"Person","name":"JsonFreeman"},"datePublished":"2015-02-11T22:04:12Z","url":"https://github.com/microsoft/TypeScript/issues/2012"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b0cb8532-d9a4-d1b5-45ac-830272ce7763
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8C8E:240CD1:11E72C1:16CFA54:6B011D5C
html-safe-nonce41c2b88ea68fc08f5b440fd01b52f13bbb5f66afe1ebb1cfc47d61f26c65a201
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzhFOjI0MENEMToxMUU3MkMxOjE2Q0ZBNTQ6NkIwMTFENUMiLCJ2aXNpdG9yX2lkIjoiMTI0ODkzMTY5NDk2MzEzNzg4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacde47215cc2408a92ee2a9261c16903c3f576afec892b21f8152e67e58783e8d3
hovercard-subject-tagissue:57384566
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Microsoft/TypeScript/2012/issue_layout
twitter:imagehttps://opengraph.githubassets.com/724a46afcc4ee2f7398e4c47e458556a4114abdc2582a6679c70bb241007cdaf/microsoft/TypeScript/issues/2012
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/724a46afcc4ee2f7398e4c47e458556a4114abdc2582a6679c70bb241007cdaf/microsoft/TypeScript/issues/2012
og:image:altI'd like to outline some of the thoughts the team has had about supporting custom ES6 symbols. This is focused on the proposals we have come up with, as well as the challenges associated with them....
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJsonFreeman
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/Microsoft/TypeScript/issues/2012#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FMicrosoft%2FTypeScript%2Fissues%2F2012
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FMicrosoft%2FTypeScript%2Fissues%2F2012
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/Microsoft/TypeScript/issues/2012
Reloadhttps://github.com/Microsoft/TypeScript/issues/2012
Reloadhttps://github.com/Microsoft/TypeScript/issues/2012
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests310 (310)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/2012
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/2012
#15473https://github.com/microsoft/TypeScript/pull/15473
Challenges with ES6 symbolshttps://github.com/microsoft/TypeScript/issues/2012#top
#15473https://github.com/microsoft/TypeScript/pull/15473
DiscussionIssues which may not have code impacthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Discussion%22
https://github.com/JsonFreeman
Jason Freeman (JsonFreeman)https://github.com/JsonFreeman
on Feb 11, 2015https://github.com/microsoft/TypeScript/issues/2012#issue-57384566
Jason Freeman (JsonFreeman)https://github.com/JsonFreeman
DiscussionIssues which may not have code impacthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Discussion%22
on Feb 11, 2015https://github.com/microsoft/TypeScript/issues/2012#event-234281358
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Feb 12, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74012489
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 12, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74031548
Jason Freeman (@JsonFreeman)https://github.com/JsonFreeman
#1003https://github.com/microsoft/TypeScript/issues/1003
https://github.com/JsonFreeman
Jason Freeman (JsonFreeman)https://github.com/JsonFreeman
on Feb 12, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74149432
Ron Buckton (@rbuckton)https://github.com/rbuckton
Troy Gerwien (@yortus)https://github.com/yortus
Troy Gerwien (@yortus)https://github.com/yortus
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 13, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74192756
Jason Freeman (@JsonFreeman)https://github.com/JsonFreeman
https://github.com/JsonFreeman
Jason Freeman (JsonFreeman)https://github.com/JsonFreeman
on Feb 13, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74197588
Troy Gerwien (@yortus)https://github.com/yortus
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 13, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74206281
Jason Freeman (@JsonFreeman)https://github.com/JsonFreeman
https://github.com/JsonFreeman
Jason Freeman (JsonFreeman)https://github.com/JsonFreeman
on Feb 13, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74337346
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
https://github.com/coreh
Marco Buono (coreh)https://github.com/coreh
on Feb 16, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74451421
Jason Freeman (@JsonFreeman)https://github.com/JsonFreeman
https://github.com/JsonFreeman
Jason Freeman (JsonFreeman)https://github.com/JsonFreeman
on Feb 16, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74451883
Marco Buono (@coreh)https://github.com/coreh
https://github.com/coreh
Marco Buono (coreh)https://github.com/coreh
on Feb 16, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74453854
https://github.com/JsonFreeman
Jason Freeman (JsonFreeman)https://github.com/JsonFreeman
on Feb 16, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-74480279
https://github.com/JsonFreeman
Jason Freeman (JsonFreeman)https://github.com/JsonFreeman
on Feb 23, 2015https://github.com/microsoft/TypeScript/issues/2012#issuecomment-75623013
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Feb 22, 2016https://github.com/microsoft/TypeScript/issues/2012#event-560338216
microsofthttps://github.com/microsoft
on Jun 18, 2018https://github.com/microsoft/TypeScript/issues/2012#event-1686921903
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/2012
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/2012
DiscussionIssues which may not have code impacthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Discussion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.