lumbda/www/repl
russell@unturf.com af0bf9cb35
bend: fix C tier LinkError — switch EM_JS to --js-library mergeInto
Browser instantiation of lumbda-c.wasm failed with:

  Aborted(LinkError: import object field 'js_lumbda_bend_call'
  is not a Function)

The wasm correctly required env.js_lumbda_bend_call as a function
import, and the EM_JS-generated function existed in the glue —
emcc placed the function declaration at depth 0 of createLumbdaC
where wasmImports lives, so it SHOULD have been hoisted into scope
at instantiate time. It worked in node test runs but threw on
browser load. The exact emcc-version cause is fuzzy; the fix is
to use the textbook mechanism instead of guessing.

New file wasm/c/bend-call-library.js — Emscripten JS library with
mergeInto(LibraryManager.library, { js_lumbda_bend_call: function(...) }).
mergeInto lands the function directly inside wasmImports under the
mangled name _js_lumbda_bend_call (auto-prefix), wired to the
js_lumbda_bend_call import. No scope guessing.

lumbda_wasm_entry.c — drops EM_JS, keeps the C wrapper bi_bend_call_wasm
and declares extern int js_lumbda_bend_call(...) so emcc emits the
env import that the library fills.

wasm/Makefile — adds --js-library c/bend-call-library.js to C_LDFLAGS
and lists the library as a dependency so changes trigger a rebuild.

Verified: deployed glue at lumbda.com now contains the mergeInto
binding (js_lumbda_bend_call:_js_lumbda_bend_call inside wasmImports).
End-to-end smoke via mocked XHR in node returns the expected
(ok pong) round-trip from the demo's first probe step.
2026-06-14 19:33:07 -04:00
..
asm wasm asm: read_string handles \" \\ \n \t escapes — bend payload works 2026-06-14 19:00:17 -04:00
c bend: fix C tier LinkError — switch EM_JS to --js-library mergeInto 2026-06-14 19:33:07 -04:00
fonts/chunkfive repl: /repl/ page with encrypted multi-tab sessions 2026-06-14 12:50:35 -04:00
python bend: wire bend!-call into the pyodide tier — playground python 2026-06-14 18:25:46 -04:00
crypto.js repl: /repl/ page with encrypted multi-tab sessions 2026-06-14 12:50:35 -04:00
index.html repl: single page scroller — header pinned, everything else flows 2026-06-14 13:21:02 -04:00
lumbda-logo-green.png repl: /repl/ page with encrypted multi-tab sessions 2026-06-14 12:50:35 -04:00
repl.css gc diagnostics: per-tier heap pressure surfaced in repl tabbar 2026-06-14 17:32:48 -04:00
repl.js gc diagnostics: per-tier heap pressure surfaced in repl tabbar 2026-06-14 17:32:48 -04:00
runner.js gc diagnostics: per-tier heap pressure surfaced in repl tabbar 2026-06-14 17:32:48 -04:00
style.css playground: status counter sits under run+cancel instead of far right 2026-06-14 16:27:05 -04:00
worker.mjs gc diagnostics: per-tier heap pressure surfaced in repl tabbar 2026-06-14 17:32:48 -04:00