lumbda/www/playground
russell@unturf.com f66124b0bc
streaming: wall-clock flush so low-rate emissions appear immediately
Worker batching used to wait for 64KB / 4096 newlines before
flushing. A program like

  (let loop ((n 0))
    (when (zero? (modulo n 10000))
      (display "Emitted at iteration: ") (display n) (newline))
    (loop (+ n 1)))

emits ~25 bytes every 10K iterations, so the user saw nothing for
several seconds — fox reported "this used to work and doesn't seem
to anymore" because the first emission was buried in the batch
buffer.

Added a 100ms wall-clock check alongside the existing size /
newline thresholds. The first chunk to arrive triggers a flush
(lastFlushTime starts at 0), and low-rate streams cap at ~10
flushes/sec. High-rate streams still hit the byte / newline ceilings
first so chunk batching for tight (display) loops is unaffected.

Verified headlessly: the infinite-emitter program now shows the
first emission within a frame, subsequent ones streaming live as
the loop iterates.
2026-06-15 20:19:39 -04:00
..
asm asm streaming: recycle the 64 KB output buffer after each flush 2026-06-15 06:36:00 -04:00
c repl: auto-pause + portal-save when leaving a tab mid-eval, resume on return 2026-06-15 09:02:53 -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 python tier: SAB-backed pause poll — auto-pause now works on python too 2026-06-15 11:16:50 -04:00
app.js playground streaming: single text node — fixes 5 functional test regressions 2026-06-15 14:04:16 -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 repl: auto-pause + portal-save when leaving a tab mid-eval, resume on return 2026-06-15 09:02:53 -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 streaming: wall-clock flush so low-rate emissions appear immediately 2026-06-15 20:19:39 -04:00