lumbda/www/playground
russell@unturf.com 89d4877ee9
playground streaming: split chunks on \n in the worker, send eol flag
After (4) rounds of newline-debugging where node tests said chunks
contained \n but fox's Firefox tab still rendered horizontal text
for the c tier (python+asm rendered vertical with the same code
path), giving up on trying to guess where the \n was being eaten
and instead getting rid of \n bytes on the wire entirely.

Worker now splits each onChunk slice on \n at the source and posts
one message per line — { kind:'chunk', tier, chunk:'tick 0', eol:true }
— so the line break is carried as a boolean flag rather than a byte.
Main thread re-attaches the '\n' before handing to liveBlock.append,
which still walks bytes for charCodeAt 10 and stacks per line.

Effectively: the loader's currentOnChunk(line + '\n') feeds the
worker which immediately splits back on the \n, both halves still
arrive on the main thread, the main thread reconstitutes them with
a fresh \n that we now know our DOM split honors (proved by the
python tier which uses the same liveBlock.append). C-tier-specific
\n loss between Module.print and postMessage drops out of the
picture.
2026-06-15 06:24:57 -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 playground: split streamed chunks into per-line divs + per-program drafts 2026-06-15 06:02:37 -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 streaming: split chunks on \n in the worker, send eol flag 2026-06-15 06:24:57 -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: split streamed chunks into per-line divs + per-program drafts 2026-06-15 06:02:37 -04:00
worker.mjs playground streaming: split chunks on \n in the worker, send eol flag 2026-06-15 06:24:57 -04:00