René's URL Explorer Experiment


Title: [fork-ffi] Performance audit across the Lua forks: uncurried shapes for Lua-specific foreigns, string accumulation, fallback coverage · Issue #186 · purescript-lua/purescript-lua · GitHub

Open Graph Title: [fork-ffi] Performance audit across the Lua forks: uncurried shapes for Lua-specific foreigns, string accumulation, fallback coverage · Issue #186 · purescript-lua/purescript-lua

X Title: [fork-ffi] Performance audit across the Lua forks: uncurried shapes for Lua-specific foreigns, string accumulation, fallback coverage · Issue #186 · purescript-lua/purescript-lua

Description: Problem Across the package-set forks, several latent performance and output-size concerns need auditing: Lua-specific foreigns declared in curried a -> b -> Effect c shapes (which compile to closure chains rather than direct calls), hot ...

Open Graph Description: Problem Across the package-set forks, several latent performance and output-size concerns need auditing: Lua-specific foreigns declared in curried a -> b -> Effect c shapes (which compile to closur...

X Description: Problem Across the package-set forks, several latent performance and output-size concerns need auditing: Lua-specific foreigns declared in curried a -> b -> Effect c shapes (which compile to ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[fork-ffi] Performance audit across the Lua forks: uncurried shapes for Lua-specific foreigns, string accumulation, fallback coverage","articleBody":"## Problem\n\nAcross the package-set forks, several latent performance and output-size concerns need auditing: Lua-specific foreigns declared in curried `a -> b -> Effect c` shapes (which compile to closure chains rather than direct calls), hot string operations that may concatenate with `..` in recursion instead of accumulating, and dead PureScript-side `*Fallback` functions that the linker retains in output. Both audit streams are only meaningful once the compiler series makes them so, hence they are scheduled rather than immediate.\n\n## Approach\n\nTwo audit streams:\n\n**1. Uncurried shapes (after #179).** Public fork APIs cannot change (they must stay API-compatible with the registry packages), so the scope is narrow: (a) Lua-specific foreigns that do not exist upstream and use curried `a -> b -> Effect c` shapes where an `EffectFn2` would compile to a direct call once #179 lands; (b) verify the arity of every `.lua` implementation against the upstream `Fn`/`EffectFn`/`STFn` declaration it backs. Historical context that this machinery is live and error-prone: #57 (`runEffectFn10` dropped its tenth argument).\n\n**2. String accumulation and fallback coverage.** Verify hot string operations accumulate via `table.concat` rather than `..` in recursion. Also map fallback coverage: the PureScript-side `*Fallback` functions (`takeFallback`, `singletonFallback`, `codePointAtFallback`, …) are dead in practice in the Lua forks — the foreigns implement the operations natively and ignore the fallback argument — yet they stay in linked output, because DCE cannot drop an argument to an opaque foreign call.\n\n## Prerequisites / Relations\n\nStream 1 depends on #179: before it lands, `EffectFn` compiles to the same closure count as curried FFI, so the audit would be pointless. #172 provides the benchmark harness that lets each finding be defended with a number. #185's constructor-representation fork audit can be scheduled into the same pass if the timing aligns. Otherwise this is package-set-level work, independent of the compiler-side issues.\n\n## Verification / Measurement\n\nThe audit produces two concrete artefacts: (1) a list of Lua-specific curried foreigns convertible to `EffectFn`/`Fn` shapes, plus confirmed-correct arity for every `.lua` implementation against its upstream declaration; and (2) a per-fork map of live vs. dead fallbacks, answering both \"where could quadratic concatenation ever run\" (only where a fallback is live) and \"how much dead fallback code the linker retains\" (an output-size observation for the compiler side). There is no standalone speed-up number for the audit itself.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-06T10:51:26Z","url":"https://github.com/purescript-lua/purescript-lua/issues/186"}

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:e0680aa6-389b-e731-1bc6-8d815d1ce943
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD5FE:1C6C3E:753BB0:9D2620:6B00D8AD
html-safe-nonce2b7b9fb37a2a0ff818dca517984fda309f0c78a6dcc44f19226854c715b2e56b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUZFOjFDNkMzRTo3NTNCQjA6OUQyNjIwOjZCMDBEOEFEIiwidmlzaXRvcl9pZCI6IjI4MjA5MjIzNzU2NDA1MDQ0OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac22403959af969afad7ab8fd91f1532e66afc72ffafaa347c66dbc186ca1898a6
hovercard-subject-tagissue:4818401493
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/purescript-lua/purescript-lua/186/issue_layout
twitter:imagehttps://opengraph.githubassets.com/86bca1086ddea4248f912ee33fec2cb47f6b2b92f72e55634c06a5d6b47712ad/purescript-lua/purescript-lua/issues/186
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/86bca1086ddea4248f912ee33fec2cb47f6b2b92f72e55634c06a5d6b47712ad/purescript-lua/purescript-lua/issues/186
og:image:altProblem Across the package-set forks, several latent performance and output-size concerns need auditing: Lua-specific foreigns declared in curried a -> b -> Effect c shapes (which compile to closur...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameUnisay
hostnamegithub.com
expected-hostnamegithub.com
Nonea481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b
turbo-cache-controlno-preview
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
release84c8c5cc25e2fb7f2308428458538436baecc6d2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/issues/186#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F186
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%2F186
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=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/186
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/186
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/186
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
https://github.com/purescript-lua/purescript-lua
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/186
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/186
[fork-ffi] Performance audit across the Lua forks: uncurried shapes for Lua-specific foreigns, string accumulation, fallback coveragehttps://github.com/purescript-lua/purescript-lua/issues/186#top
https://github.com/Unisay
OptimisationA Compiler Optimisationhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22Optimisation%22
area: package-setBug in a package-set fork (FFI/sources), not the compilerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20package-set%22
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jul 6, 2026https://github.com/purescript-lua/purescript-lua/issues/186#issue-4818401493
#179https://github.com/purescript-lua/purescript-lua/issues/179
#179https://github.com/purescript-lua/purescript-lua/issues/179
#57https://github.com/purescript-lua/purescript-lua/issues/57
#179https://github.com/purescript-lua/purescript-lua/issues/179
#172https://github.com/purescript-lua/purescript-lua/issues/172
#185https://github.com/purescript-lua/purescript-lua/issues/185
Unisayhttps://github.com/Unisay
area: package-setBug in a package-set fork (FFI/sources), not the compilerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20package-set%22
OptimisationA Compiler Optimisationhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22Optimisation%22
on Jul 6, 2026https://github.com/purescript-lua/purescript-lua/issues/186#event-27603308244
Unisayhttps://github.com/Unisay
on Jul 8, 2026https://github.com/purescript-lua/purescript-lua/issues/186#event-27606262036
Closing audit: prove the cumulative win of the optimisation series #187https://github.com/purescript-lua/purescript-lua/issues/187
LuaJIT blacklists loopified self-recursion while the loop body still allocates closures #204https://github.com/purescript-lua/purescript-lua/issues/204
CPR-style worker/wrapper on results: return constructed products as Lua multiple values #206https://github.com/purescript-lua/purescript-lua/issues/206
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jul 13, 2026https://github.com/purescript-lua/purescript-lua/issues/186#issuecomment-4958703709
#57https://github.com/purescript-lua/purescript-lua/issues/57
fix: restore the STFn calling convention in the Data.Array.ST FFI purescript-lua-arrays#3https://github.com/purescript-lua/purescript-lua-arrays/pull/3
fix: fromStringImpl is the 4-ary function its Fn4 declaration requires purescript-lua-numbers#9https://github.com/purescript-lua/purescript-lua-numbers/pull/9
purescript-lua/purescript-lua-ngx#8https://github.com/purescript-lua/purescript-lua-ngx/pull/8
Unisay/purescript-lua-coroutine#1https://github.com/Unisay/purescript-lua-coroutine/pull/1
Unisay/purescript-lua-coroutine#1https://github.com/Unisay/purescript-lua-coroutine/pull/1
#271https://github.com/purescript-lua/purescript-lua/issues/271
#228https://github.com/purescript-lua/purescript-lua/issues/228
#233https://github.com/purescript-lua/purescript-lua/issues/233
#236https://github.com/purescript-lua/purescript-lua/issues/236
#247https://github.com/purescript-lua/purescript-lua/issues/247
#233https://github.com/purescript-lua/purescript-lua/issues/233
purescript-lua/purescript-lua-integers#7https://github.com/purescript-lua/purescript-lua-integers/pull/7
#270https://github.com/purescript-lua/purescript-lua/issues/270
#267https://github.com/purescript-lua/purescript-lua/issues/267
#268https://github.com/purescript-lua/purescript-lua/issues/268
#269https://github.com/purescript-lua/purescript-lua/issues/269
#72https://github.com/purescript-lua/purescript-lua/issues/72
Unisayhttps://github.com/Unisay
on Jul 13, 2026https://github.com/purescript-lua/purescript-lua/issues/186#event-27911977267
fix: fromStringImpl is the 4-ary function its Fn4 declaration requireshttps://github.com/purescript-lua/purescript-lua-numbers/commit/39b77f64fb22c8174d4c85a97eb9efb56739985c
39b77f6https://github.com/purescript-lua/purescript-lua-numbers/commit/39b77f64fb22c8174d4c85a97eb9efb56739985c
fix: restore the STFn calling convention in the Data.Array.ST FFIhttps://github.com/purescript-lua/purescript-lua-arrays/commit/7b874bd0a3796dafb5b8cddf5f2e7a5be94d2729
7b874bdhttps://github.com/purescript-lua/purescript-lua-arrays/commit/7b874bd0a3796dafb5b8cddf5f2e7a5be94d2729
perf: toStringAs appends digits and reverses oncehttps://github.com/purescript-lua/purescript-lua-integers/commit/f0831bc06d6b89d6e83fed2f64bf656c816677af
f0831bchttps://github.com/purescript-lua/purescript-lua-integers/commit/f0831bc06d6b89d6e83fed2f64bf656c816677af
perf: back say and Http.Status.set with EffectFn1 foreignshttps://github.com/purescript-lua/purescript-lua-ngx/commit/92e88d8376a67b2f0a162e5badf74855f45f661d
92e88d8https://github.com/purescript-lua/purescript-lua-ngx/commit/92e88d8376a67b2f0a162e5badf74855f45f661d
perf: back the coroutine foreigns with EffectFn shapeshttps://github.com/Unisay/purescript-lua-coroutine/commit/5222af1554cb9d93073e796f57709c876a858d02
5222af1https://github.com/Unisay/purescript-lua-coroutine/commit/5222af1554cb9d93073e796f57709c876a858d02
fix: fromStringImpl is the 4-ary function its Fn4 declaration requireshttps://github.com/purescript-lua/purescript-lua-numbers/commit/b38c16d9e0ad3f557bff878156f95e42b2c3781d
b38c16dhttps://github.com/purescript-lua/purescript-lua-numbers/commit/b38c16d9e0ad3f557bff878156f95e42b2c3781d
chore: bump arrays, numbers, integers, lua-ngx (fork-FFI audit fixes)https://github.com/purescript-lua/purescript-lua-package-sets/commit/c682dbe6469bee78a9da3a0a16e4fa473bb845fc
c682dbehttps://github.com/purescript-lua/purescript-lua-package-sets/commit/c682dbe6469bee78a9da3a0a16e4fa473bb845fc
test(ps): repoint the golden set at psc-0.15.15-20260713https://github.com/purescript-lua/purescript-lua/commit/9ffb82ff082072229acbd36d491fb8e9af525414
9ffb82fhttps://github.com/purescript-lua/purescript-lua/commit/9ffb82ff082072229acbd36d491fb8e9af525414
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jul 13, 2026https://github.com/purescript-lua/purescript-lua/issues/186#issuecomment-4958877461
9ffb82fhttps://github.com/purescript-lua/purescript-lua/commit/9ffb82ff082072229acbd36d491fb8e9af525414
#267https://github.com/purescript-lua/purescript-lua/issues/267
#268https://github.com/purescript-lua/purescript-lua/issues/268
#269https://github.com/purescript-lua/purescript-lua/issues/269
#270https://github.com/purescript-lua/purescript-lua/issues/270
#271https://github.com/purescript-lua/purescript-lua/issues/271
#72https://github.com/purescript-lua/purescript-lua/issues/72
Unisayhttps://github.com/Unisay
completedhttps://github.com/purescript-lua/purescript-lua/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 13, 2026https://github.com/purescript-lua/purescript-lua/issues/186#event-27912681238
Unisayhttps://github.com/Unisay
on Jul 13, 2026https://github.com/purescript-lua/purescript-lua/issues/186#event-27913377260
Sign up for freehttps://github.com/signup?return_to=https://github.com/purescript-lua/purescript-lua/issues/186
Sign in to commenthttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/186
Unisayhttps://github.com/Unisay
OptimisationA Compiler Optimisationhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22Optimisation%22
area: package-setBug in a package-set fork (FFI/sources), not the compilerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20package-set%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.