René's URL Explorer Experiment


Title: Handwritten semantic-rewrite layer for record surgery and identity foreigns · Issue #236 · purescript-lua/purescript-lua · GitHub

Open Graph Title: Handwritten semantic-rewrite layer for record surgery and identity foreigns · Issue #236 · purescript-lua/purescript-lua

X Title: Handwritten semantic-rewrite layer for record surgery and identity foreigns · Issue #236 · purescript-lua/purescript-lua

Description: Purescript compiler back-end for Lua. Contribute to purescript-lua/purescript-lua development by creating an account on GitHub.

Open Graph Description: Purescript compiler back-end for Lua. Contribute to purescript-lua/purescript-lua development by creating an account on GitHub.

X Description: Purescript compiler back-end for Lua. Contribute to purescript-lua/purescript-lua development by creating an account on GitHub.

Opengraph URL: https://github.com/purescript-lua/purescript-lua

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Handwritten semantic-rewrite layer for record surgery and identity foreigns","articleBody":"## Problem\n\nThe source-derived `ForeignLift` (#178) is the right tool for scalar primops and uncurried wrappers: it reads the real FFI source, so the registry cannot drift from the package. But a class of higher-level rewrites cannot be expressed as a lift of FFI source: record surgery (`Record.Builder.unsafeInsert`/`Delete`/`Modify`, `Record.Unsafe.unsafeGet`/`Set`/`Has`, `unsafeUnionFn`) and identity foreigns (`unsafeCoerce a → a`, `Record.Builder.copyRecord r → r`). A small handwritten registry folds these: when the record is statically known, the surgery collapses into a record literal or update, and the identity coercions vanish. On the Lua target, where a table allocation is expensive, folding record surgery on a known record removes a real allocation.\n\n## Approach\n\nA narrow handwritten semantic layer on top of `ForeignLift`, keyed by qualified name and spine shape, kept small. When the record operand is a manifest literal or update, rewrite the surgery into the resulting literal/update; rewrite `unsafeCoerce`/`copyRecord` to their argument unconditionally. Anything not statically known is left as a call. This stays strictly complementary to the source-derived lift: no scalar or uncurried rewrites move here.\n\n## Prerequisites / Relations\n\nIndependent. Complements `ForeignLift` (#178) rather than replacing it, and relates to the allowlist-extension direction. Ordering fusion (`compare … is LT → \u003c`) is deliberately out of scope: it is already covered by #180 (Ordering-constructor collapse through the if-tree) plus #220 and #222.\n\n## Verification / Measurement\n\n`unsafeInsert \"k\" v \u003crecord literal>` folds to a record literal carrying the new field, and `unsafeCoerce x` to `x`, in focused optimizer tests; a surgery on an unknown record is left as a call. Allocation-counter drop on a record-builder benchmark through #172; eval goldens unchanged.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-11T12:02:45Z","url":"https://github.com/purescript-lua/purescript-lua/issues/236"}

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/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:560b2941-6254-2ebe-eb5b-a705a613437a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8DD4:26ECEB:9B86EE:C9966D:6B00E044
html-safe-nonced7318b8a0d2280046a78ccccb509c0d5cc450c71b1b8100730096a5988935fcc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REQ0OjI2RUNFQjo5Qjg2RUU6Qzk5NjZEOjZCMDBFMDQ0IiwidmlzaXRvcl9pZCI6IjU0NDcyNDU1NTM3NDAwNzkxNzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaceb3414fcabd95103b8ff1ae1937f2d9acbdab7b4798f559664d389ed3a426747
hovercard-subject-tagrepository:587200487
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/purescript-lua/purescript-lua/issues/236
twitter:imagehttps://opengraph.githubassets.com/638e8137a878305176b6a64ef473983d87906a525f956c0c5c3b1c72df4432e4/purescript-lua/purescript-lua
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/638e8137a878305176b6a64ef473983d87906a525f956c0c5c3b1c72df4432e4/purescript-lua/purescript-lua
og:image:altPurescript compiler back-end for Lua. Contribute to purescript-lua/purescript-lua development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-cache
go-importgithub.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git
octolytics-dimension-user_id131581790
octolytics-dimension-user_loginpurescript-lua
octolytics-dimension-repository_id587200487
octolytics-dimension-repository_nwopurescript-lua/purescript-lua
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id587200487
octolytics-dimension-repository_network_root_nwopurescript-lua/purescript-lua
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
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/issues/236#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F236
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%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F236
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/236
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/236
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/236
https://github.com/purescript-lua/purescript-lua
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/236
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/236
#304https://github.com/purescript-lua/purescript-lua/pull/304
Handwritten semantic-rewrite layer for record surgery and identity foreignshttps://github.com/purescript-lua/purescript-lua/issues/236#top
#304https://github.com/purescript-lua/purescript-lua/pull/304
https://github.com/Unisay
OptimisationA Compiler Optimisationhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22Optimisation%22
area: irIR / optimizer / DCE / inlinerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20ir%22
enhancementNew feature or requesthttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jul 11, 2026https://github.com/purescript-lua/purescript-lua/issues/236#issue-4862140301
#178https://github.com/purescript-lua/purescript-lua/issues/178
#178https://github.com/purescript-lua/purescript-lua/issues/178
#180https://github.com/purescript-lua/purescript-lua/issues/180
#220https://github.com/purescript-lua/purescript-lua/issues/220
#222https://github.com/purescript-lua/purescript-lua/issues/222
#172https://github.com/purescript-lua/purescript-lua/issues/172
Unisayhttps://github.com/Unisay
enhancementNew feature or requesthttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22enhancement%22
area: irIR / optimizer / DCE / inlinerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20ir%22
OptimisationA Compiler Optimisationhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22Optimisation%22
on Jul 11, 2026https://github.com/purescript-lua/purescript-lua/issues/236#event-27851251331
Unisayhttps://github.com/Unisay
on Jul 26, 2026https://github.com/purescript-lua/purescript-lua/issues/236#event-28498552615
Unisayhttps://github.com/Unisay
completedhttps://github.com/purescript-lua/purescript-lua/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#304https://github.com/purescript-lua/purescript-lua/pull/304
on Jul 26, 2026https://github.com/purescript-lua/purescript-lua/issues/236#event-28502097617
Sign up for freehttps://github.com/signup?return_to=https://github.com/purescript-lua/purescript-lua/issues/236
Sign in to commenthttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/236
Unisayhttps://github.com/Unisay
OptimisationA Compiler Optimisationhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22Optimisation%22
area: irIR / optimizer / DCE / inlinerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20ir%22
enhancementNew feature or requesthttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22enhancement%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.