lumbda/www
russell@unturf.com d14c0eb5e4
wasm asm: stream output line-by-line via new emit_chunk env import
Brings the WAT tier to parity with c-emcc and pyodide for streaming
output during evalLisp. Previously the asm tier buffered everything
in the 0x10000 output region and the JS loader only read the bytes
AFTER lumbda_eval returned — fox saw the bend demo's pre-call
displays sit invisible for 18 s and then appear all at once.

WAT-side changes:

  - New env.emit_chunk(ptr, len) import. Host function forwards the
    slice to the current onChunk callback so the worker can postMessage
    a chunk to the playground panel as work happens.
  - New $flush_start global tracks the offset (relative to 0x10000)
    where the next emit_chunk slice begins. Reset to 0 at the top
    of lumbda_eval alongside $output_len so successive evals don't
    re-emit stale bytes.
  - $out_char now checks for newline (i32.const 10) after the store.
    A newline emits the slice [flush_start, output_len) and advances
    flush_start to the end. Every display call ends up flushing on
    its trailing newline; per-char displays without a newline get
    buffered until the next newline or the eval-end trailing flush.
  - $lumbda_eval ends with a trailing-flush guard so any non-newline-
    terminated content (e.g. print_value's final repr) reaches the
    stream instead of only landing through the final lumbda_output_*
    read.

JS loader:

  - importObj.env.emit_chunk decodes the slice from wasm memory and
    forwards to refs.currentOnChunk.
  - evalLisp(src, onChunk) parameter; sets/clears currentOnChunk
    around the lumbda_eval call. Same shape as c-emcc + pyodide.

Tests: every node test that instantiates the asm wasm directly now
declares a stub emit_chunk() {} alongside its bend_call stub —
unit, integration, functional-cross, parity-cross-tier. Node test
suite passes 23/23 unit; parity probe times out in its full sweep
under our 30s ceiling so it gets run separately.

Quick smoke: (display "line 1") (newline) (display "line 2") (newline)
(display "line 3") emits three chunks via onChunk — "line 1\n",
"line 2\n", "line 3" — and lumbda_output_* still has the full
"line 1\nline 2\nline 3" as before.
2026-06-14 20:35:13 -04:00
..
fonts/chunkfive www: ChunkFive for logo/titles; normalize asm references to "GNU asm" 2026-04-19 16:08:02 -04:00
playground wasm asm: stream output line-by-line via new emit_chunk env import 2026-06-14 20:35:13 -04:00
repl wasm asm: stream output line-by-line via new emit_chunk env import 2026-06-14 20:35:13 -04:00
404.html www/: static docroot for lumbda.com 2026-04-19 11:21:56 -04:00
bend.html bend: dual-port worker (8320 wire + 8321 http) — playground onramp 2026-06-14 17:32:46 -04:00
index.html playground: free-form code option + encrypted vault, single-scroll layout 2026-06-14 12:56:25 -04:00
lumbda-logo-green.png www + whitepaper: adopt custom λ mark from MPS, green, 3× wordmark size 2026-04-19 17:32:43 -04:00
lumbda-logo.png www + whitepaper: adopt custom λ mark from MPS, green, 3× wordmark size 2026-04-19 17:32:43 -04:00
lumbda-whitepaper.html www: HTML whitepaper + prose rewrite avoiding "to be" and "the" 2026-04-19 16:23:56 -04:00
lumbda-whitepaper.pdf www: canonical slug /lumbda-whitepaper.pdf + embed uncloseai.js 2026-04-19 16:17:43 -04:00
robots.txt www/: static docroot for lumbda.com 2026-04-19 11:21:56 -04:00
style.css logo: revert artwork to source orientation (was over-flipped) 2026-04-19 17:42:14 -04:00