René's URL Explorer Experiment


Title: docs: document core compiler invariants as GHC-style Notes (#44) by Unisay · Pull Request #124 · purescript-lua/purescript-lua · GitHub

Open Graph Title: docs: document core compiler invariants as GHC-style Notes (#44) by Unisay · Pull Request #124 · purescript-lua/purescript-lua

X Title: docs: document core compiler invariants as GHC-style Notes (#44) by Unisay · Pull Request #124 · purescript-lua/purescript-lua

Description: Summary Part of #44, the first batch. It documents three load-bearing invariants as GHC-style Notes and points each dependent site back at them with a See Note comment. The change is comments only, so generated code, goldens, and eval oracles are unchanged. Note [PSString is UTF-16 code units, not text] in PSString. A PSString is a sequence of UTF-16 code units that may contain lone surrogates, so it is not always well-formed text. Two things lean on that. CoreFn JSON encodes such a string either as a JSON string or as an array of code units, so FromJSON has to accept both shapes. And code generation escapes rather than decodes, because a lone surrogate has no Char. Cited from CoreFn.FromJSON and the IR and Lua literal sites. Note [The PSLUA_runtime_lazy coupling] in Names. The bare string PSLUA_runtime_lazy ties four sites together: the ident the laziness transform emits, the hand-written Lua fixture of the same name, the scan in IR.Query that decides the fixture is referenced, and the emit gate in the backend. Rename either side and the halves stop matching, so the fixture is dropped as unused or the generated code calls a binding that was never emitted. Cited from Lua.Fixture, IR.Query, Backend, and the emitter in Backend.Lua. Note [Graph-based dead code elimination for Lua] in Lua.DCE. An overview of the four steps the module's six helpers implement: key and scope every node, build a dependency graph, compute reachability from the entry set, then prune unreachable bindings (demoting unused parameters rather than removing them, to keep arity). I kept this batch to invariants that do not touch CoreFn.Laziness. That file is adapted from upstream purs, and the issue asks to weigh the divergence before retitling its comments, so its Notes will come in a later batch along with the decision-tree and Linker items. Checklist Added a changelog.d/ fragment for any user-facing change (scriv create in the dev shell), or this change ships nothing releasable (CI, docs, or an internal refactor). In the dev shell (nix develop), fourmolu -i lib/ exe/ test/ and hlint lib/ exe/ test/ are clean. In the dev shell, cabal test all passes; structural goldens were re-accepted on purpose if codegen moved (PSLUA_GOLDEN_ACCEPT=1), and eval/golden.txt still holds.

Open Graph Description: Summary Part of #44, the first batch. It documents three load-bearing invariants as GHC-style Notes and points each dependent site back at them with a See Note comment. The change is comments only,...

X Description: Summary Part of #44, the first batch. It documents three load-bearing invariants as GHC-style Notes and points each dependent site back at them with a See Note comment. The change is comments only,...

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

X: @github

direct link

Domain: github.com

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/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:04176ad4-3b66-64de-c291-c0429624d22f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDC6E:19AA62:B81B95:EB5C6E:6B00F9C7
html-safe-nonce3b9d053d40b3350b48e1d176059899466acb6ec4f5a0815ce5cfde62e9600f03
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzZFOjE5QUE2MjpCODFCOTU6RUI1QzZFOjZCMDBGOUM3IiwidmlzaXRvcl9pZCI6Ijc2MTYyMDg3ODg0NTM5MTUwNzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8c3f2b4f1f9bffe369e675a09cb14f314ad16028291e1003338e2733ac38f2f0
hovercard-subject-tagpull_request:3934550786
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/purescript-lua/purescript-lua/pull/124/files
twitter:imagehttps://avatars.githubusercontent.com/u/1009751?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1009751?s=400&v=4
og:image:altSummary Part of #44, the first batch. It documents three load-bearing invariants as GHC-style Notes and points each dependent site back at them with a See Note comment. The change is comments only,...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonee208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7dafd017fb7809a839c443dba08622af38e63c09
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/pull/124/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fpull%2F124%2Ffiles
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%2Fpull%2F124%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/124/files
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/124/files
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/124/files
purescript-luahttps://github.com/purescript-lua
purescript-luahttps://github.com/purescript-lua/purescript-lua
Codehttps://github.com/purescript-lua/purescript-lua
Issues48 (48)https://github.com/purescript-lua/purescript-lua/issues
Pull requestshttps://github.com/purescript-lua/purescript-lua/pulls
Discussionshttps://github.com/purescript-lua/purescript-lua/discussions
Actionshttps://github.com/purescript-lua/purescript-lua/actions
Projectshttps://github.com/purescript-lua/purescript-lua/projects
Security and qualityhttps://github.com/purescript-lua/purescript-lua/security
Insightshttps://github.com/purescript-lua/purescript-lua/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2Fnew%2Fchoose
Unisayhttps://github.com/Unisay
mainhttps://github.com/purescript-lua/purescript-lua/tree/main
issue-44/notes-core-invariantshttps://github.com/purescript-lua/purescript-lua/tree/issue-44/notes-core-invariants
Conversation 1 https://github.com/purescript-lua/purescript-lua/pull/124
Commits 1 https://github.com/purescript-lua/purescript-lua/pull/124/commits
Checks 2 https://github.com/purescript-lua/purescript-lua/pull/124/checks
Files changed https://github.com/purescript-lua/purescript-lua/pull/124/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/124/files
docs: document core compiler invariants as GHC-style Notes (#44) https://github.com/purescript-lua/purescript-lua/pull/124/files#top
Show all changes 1 commit https://github.com/purescript-lua/purescript-lua/pull/124/files
3d5cc08 docs: document core compiler invariants as GHC-style Notes (#44) Unisay Jun 25, 2026 https://github.com/purescript-lua/purescript-lua/pull/124/commits/3d5cc08e2a245ef0169abebe9a82753ed2f89983
Clear filters https://github.com/purescript-lua/purescript-lua/pull/124/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/124/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/124/files
20260625_123034_unisay_notes_core_invariants.md https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-7ceae750a867a66396d02894ce3ff6c4c9d606c389e6818ce17528cb1d047447
Backend.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-c7b61c0a5ec94432343188b6840d78294db6703c8ef65baf74d41ddd0ec5ba94
IR.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-b2e6467526a4a74dfd4d619dae7237fb05d5ad4386d4f8a893d4f82b4c31cd39
Query.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-c2db179b779dc853e8aed558f6757abc4bb11d5527b68b571814449b5cf5e203
Lua.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
DCE.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-1e6efc2ded9d4585a8f795d2441ac1919743abe2a81263edd5c6ab171e4fffca
Fixture.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-dfc024b7df4b318856630a367ba4df5944cca498cd9ce3a4135650d777d8839c
FromJSON.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-da1135ed2b16ab9c0035e9e016816955b05b23358162567352aef1bd7cb2eec6
Names.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-4d546d455693baec3151e530e5cf1cb72b25712454f2b2d9358605ea6980f5fe
PSString.hs https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-20fb28efc47762dbd62330385c6b7afec6e6b467802cddb43d598a72c9b2d512
changelog.d/20260625_123034_unisay_notes_core_invariants.mdhttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-7ceae750a867a66396d02894ce3ff6c4c9d606c389e6818ce17528cb1d047447
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/changelog.d/20260625_123034_unisay_notes_core_invariants.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
lib/Language/PureScript/Backend.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-c7b61c0a5ec94432343188b6840d78294db6703c8ef65baf74d41ddd0ec5ba94
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/Backend.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-c7b61c0a5ec94432343188b6840d78294db6703c8ef65baf74d41ddd0ec5ba94
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-c7b61c0a5ec94432343188b6840d78294db6703c8ef65baf74d41ddd0ec5ba94
lib/Language/PureScript/Backend/IR.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-b2e6467526a4a74dfd4d619dae7237fb05d5ad4386d4f8a893d4f82b4c31cd39
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/Backend/IR.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-b2e6467526a4a74dfd4d619dae7237fb05d5ad4386d4f8a893d4f82b4c31cd39
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-b2e6467526a4a74dfd4d619dae7237fb05d5ad4386d4f8a893d4f82b4c31cd39
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-b2e6467526a4a74dfd4d619dae7237fb05d5ad4386d4f8a893d4f82b4c31cd39
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-b2e6467526a4a74dfd4d619dae7237fb05d5ad4386d4f8a893d4f82b4c31cd39
lib/Language/PureScript/Backend/IR/Query.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-c2db179b779dc853e8aed558f6757abc4bb11d5527b68b571814449b5cf5e203
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/Backend/IR/Query.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-c2db179b779dc853e8aed558f6757abc4bb11d5527b68b571814449b5cf5e203
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-c2db179b779dc853e8aed558f6757abc4bb11d5527b68b571814449b5cf5e203
lib/Language/PureScript/Backend/Lua.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/Backend/Lua.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-11295f6f97401e5cc1fdfa2a8caa3fc80edc56cd58262d3de010e803f8d3640f
lib/Language/PureScript/Backend/Lua/DCE.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-1e6efc2ded9d4585a8f795d2441ac1919743abe2a81263edd5c6ab171e4fffca
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/Backend/Lua/DCE.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-1e6efc2ded9d4585a8f795d2441ac1919743abe2a81263edd5c6ab171e4fffca
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-1e6efc2ded9d4585a8f795d2441ac1919743abe2a81263edd5c6ab171e4fffca
lib/Language/PureScript/Backend/Lua/Fixture.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-dfc024b7df4b318856630a367ba4df5944cca498cd9ce3a4135650d777d8839c
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/Backend/Lua/Fixture.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-dfc024b7df4b318856630a367ba4df5944cca498cd9ce3a4135650d777d8839c
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-dfc024b7df4b318856630a367ba4df5944cca498cd9ce3a4135650d777d8839c
lib/Language/PureScript/CoreFn/FromJSON.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-da1135ed2b16ab9c0035e9e016816955b05b23358162567352aef1bd7cb2eec6
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/CoreFn/FromJSON.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-da1135ed2b16ab9c0035e9e016816955b05b23358162567352aef1bd7cb2eec6
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-da1135ed2b16ab9c0035e9e016816955b05b23358162567352aef1bd7cb2eec6
lib/Language/PureScript/Names.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-4d546d455693baec3151e530e5cf1cb72b25712454f2b2d9358605ea6980f5fe
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/Names.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-4d546d455693baec3151e530e5cf1cb72b25712454f2b2d9358605ea6980f5fe
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-4d546d455693baec3151e530e5cf1cb72b25712454f2b2d9358605ea6980f5fe
lib/Language/PureScript/PSString.hshttps://github.com/purescript-lua/purescript-lua/pull/124/files#diff-20fb28efc47762dbd62330385c6b7afec6e6b467802cddb43d598a72c9b2d512
View file https://github.com/purescript-lua/purescript-lua/blob/3d5cc08e2a245ef0169abebe9a82753ed2f89983/lib/Language/PureScript/PSString.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/124/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-20fb28efc47762dbd62330385c6b7afec6e6b467802cddb43d598a72c9b2d512
https://github.com/purescript-lua/purescript-lua/pull/124/files#diff-20fb28efc47762dbd62330385c6b7afec6e6b467802cddb43d598a72c9b2d512
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/124/files
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.