lumbda/wasm
russell@unturf.com 32d38754f8
playground streaming: appendChild(TextNode) instead of textContent +=
liveBlock.append was doing `pre.textContent += chunk` on every
streamed chunk. textContent's setter wipes all existing child
nodes and creates a single new text node from the concatenated
read+new value — perfectly correct semantically but under a fast
C-tier emit loop (one chunk per (newline) printf) the per-update
restringify was visibly dropping line breaks, rendering

  tick 0tick 10000tick 20000tick 30000…

horizontally instead of stacking vertically.

`pre.appendChild(document.createTextNode(chunk))` appends a new
text node alongside existing ones — no read-back, no restringify.
Browser renders the sequence of text nodes as concatenated text
inside the <pre> which already has `white-space: pre`, so every
embedded \n produces a real line break.

Pairs with the c-tier loader's `currentOnChunk(line + "\n")` fix:
loader adds the \n that Emscripten's Module.print convention
stripped, append preserves the \n end-to-end into the DOM.
2026-06-15 05:42:02 -04:00
..
app playground streaming: appendChild(TextNode) instead of textContent += 2026-06-15 05:42:02 -04:00
asm wasm asm: stream output line-by-line via new emit_chunk env import 2026-06-14 20:35:13 -04:00
c c-tier streaming: re-add the trailing newline emcc strips before postMessage 2026-06-15 05:38:03 -04:00
dist-repl c-tier streaming: re-add the trailing newline emcc strips before postMessage 2026-06-15 05:38:03 -04:00
python playground: stream tier output line-by-line during eval 2026-06-14 20:25:47 -04:00
repl gc diagnostics: per-tier heap pressure surfaced in repl tabbar 2026-06-14 17:32:48 -04:00
tests wasm asm: stream output line-by-line via new emit_chunk env import 2026-06-14 20:35:13 -04:00
Makefile bend: fix C tier LinkError — switch EM_JS to --js-library mergeInto 2026-06-14 19:33:07 -04:00