Repository navigation
Conversation
Lorenzobattistela
left a comment
There was a problem hiding this comment.
Thanks, the fix works: foreign_only_fid is now emitted and runs, and namespaced FID(L.hidden) resolves. I merged main into the branch to resolve the conflict with #1653 (d48dfb3): ID_WORDS uses #1653's //.* comment rule, and effect_src splices C backslash-newlines when it caches the source, so the FID scan and the emitted C both see the spliced text. Please pull before pushing again.
Merged onto main d0d0c21: repo 54/54, ping 63/63, perf 124/124, safe 0 false rejects. Test is 1672/1673. Four things need to change before merge:
-
tests/io/foreign_only_fidfails the test gate:FAIL io_foreign_only_fid [check] observed: Error: a foreign def without a .js import: answerThe gate always checks and interprets through JS, so every effect test needs a
.jstwin, and this is the only C-only one. Please addforeign_only_fid.js. While there, please also add a test wherehiddenhas exactly one Bend callsite (so it's fused into its caller) and is also called throughFID. The PR fixes that case too (main fails at clang), but no test covers it. -
The
#in the new lookbehind breaks C token pasting. This effect works on main and fails on the PR:#define ID_OF(x) x##CID(answer) ... io_eff(ID_OF(), answer_run);main prints 42; PR:
error: call to undeclared function 'CID'. The#is only needed for JS private names, so please apply it only to the JS lane. -
The FID scan now also runs on the JS lane, where FID is just a name string. A
.jseffect that mentionsFID(helper), wherehelperis a foreign def with only a.cimport, now dies at build time:Error: a foreign def without a .js import: helper. The same program builds and prints 42 on main. The scan only needs to root FIDs for the C build. -
Please drop the
guide/EFFECTS.mdchange; we keep guide prose out of fix PRs.
|
Fetched your d48dfb3 merge first. I’m adding the JS twin and the fused-call regression, making the |
|
Thanks — pushed 1873a49 on top of your d48dfb3 merge. The JS twin and single-call FID test are in, token-pasted CID works again in C, and a JS FID string no longer pulls in a C-only foreign def. guide/EFFECTS.md matches main again. All three fixtures pass --checkup, the interpreter, emitted JS and native C locally; repo is 54/54. I haven’t run the private cluster gates. |
C effects can call functions that Bend never calls, or calls just once. Keep a native entry for those FID references instead of dropping or fusing it away. This rooting is C-only; JS FID stays a name string.
Host identifiers and JS private names stay untouched, without breaking C token pasting. Your d48dfb3 merge is included, and the guide prose is out.
All three fixtures pass --checkup, the interpreter, emitted JS and native C locally. Repo: 54/54. No private-cluster run claimed.
Fixes #1711
Fixes #1712