lumbda/www/playground
russell@unturf.com cf7ff2219f
c-tier streaming: re-add the trailing newline emcc strips before postMessage
Emscripten's Module.print fires once per line and hands the loader
just the line content — no trailing newline; the caller is expected
to add it back when joining (outBuf.join('\n') does that for the
final return). Streaming path was forwarding the line straight to
onChunk without the newline, so successive chunks concatenated
horizontally in the playground panel — the loop

  (let loop ((i 0))
    (cond ((= (modulo i 10000) 0) (display \"tick \") (display i) (newline)))
    (loop (+ i 1)))

was running fine on c tier (each (newline) ended a printf line) but
arriving in the UI as 'tick 0tick 10000tick 20000...' with no
breaks.

Loader's print/printErr callbacks now pass `line + \"\\n\"` to
currentOnChunk. Final buffered join (which already adds the \\n)
is untouched, so the post-eval output string keeps the same shape.
Pyodide _StreamingStdout sees Python's raw write() bytes including
the \\n already; asm's emit_chunk fires AFTER output_len was
incremented past the \\n, so the slice [flush_start, output_len)
includes it. Neither needed a change.
2026-06-15 05:38:03 -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
demos bend: handler returns formatted string + http-listener ships strings raw 2026-06-14 20:15:37 -04:00
fonts/chunkfive wasm/playground: cancel button, asm state-leak fix, restyle to match homepage 2026-06-14 12:13:20 -04:00
python playground: stream tier output line-by-line during eval 2026-06-14 20:25:47 -04:00
app.js playground: stream tier output line-by-line during eval 2026-06-14 20:25:47 -04:00
crypto.js playground: free-form code option + encrypted vault, single-scroll layout 2026-06-14 12:56:25 -04:00
index.html playground footer: surface what's locked + what's still WIP (call/cc, macros, portal) 2026-06-14 17:27:17 -04:00
lumbda-logo-green.png wasm/playground: cancel button, asm state-leak fix, restyle to match homepage 2026-06-14 12:13:20 -04:00
runner.js playground: stream tier output line-by-line during eval 2026-06-14 20:25:47 -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 playground: stream tier output line-by-line during eval 2026-06-14 20:25:47 -04:00