lumbda/wasm
russell@unturf.com 1458ebf77a
bend: wire bend!-call into the Emscripten C tier — playground c
lumbda_wasm_entry.c — adds an EM_JS bridge js_lumbda_bend_call that
does sync XHR POST (legal inside Web Workers, the playground's tier
host) and writes the response bytes back into the wasm heap. C
wrapper bi_bend_call_wasm allocates a 256 KiB response buffer, calls
the EM_JS function, wraps the bytes as a lumbda string Value, and
gets registered as the `bend!-call` builtin in lumbda_wasm_init —
not in c/builtins.c, so the native CLI build doesn't acquire a
wasm-flavored binding it can't satisfy.

lumbda-c.loader.js — setBendUrl(url) mutates globalThis._lumbdaCBendUrl
which the EM_JS reads on every call. runner.js plumbing already
propagates a saved playground URL to every tier's setBendUrl on
each save.

C tier now matches asm + pyodide for HTTP-mode bend. End-to-end
verified in node + wasm directly: bend!-call returns the configured
URL response text; "no bend URL configured" when unset; clean
"bend error: ..." string when the XHR throws (e.g., CORS, network).
Tested against the live bend.unturf.com chain via the playground.

Three tiers in parallel now show the same (ok (HEX0 HEX1 HEX2))
result from (cuda-shake-fanout ("00" "01" "deadbeef") 32).
2026-06-14 19:04:52 -04:00
..
app bend: defensive errors when daemons missing + demo round-trips real ops 2026-06-14 18:12:47 -04:00
asm wasm asm: read_string handles \" \\ \n \t escapes — bend payload works 2026-06-14 19:00:17 -04:00
c bend: wire bend!-call into the Emscripten C tier — playground c 2026-06-14 19:04:52 -04:00
dist-repl bend: wire bend!-call into the Emscripten C tier — playground c 2026-06-14 19:04:52 -04:00
python bend: wire bend!-call into the pyodide tier — playground python 2026-06-14 18:25:46 -04:00
repl gc diagnostics: per-tier heap pressure surfaced in repl tabbar 2026-06-14 17:32:48 -04:00
tests wat: internal-define scoping (R7RS letrec*) + c-wasm gc gap documented 2026-06-14 17:54:33 -04:00
Makefile parity probe: cross-tier corpus + fix python remainder + asm modulo 2026-06-14 15:21:19 -04:00