writeonce/docs/examples/fibers
shoney.arickathil 23550e7021 feat(lang+wo-html): raw text literals, component layer, MVC samples
- lexer: backtick raw text literal — content verbatim, no escape
  processing, common source margin removed at lex time; `${ }` raw and
  `{{ }}` auto-escaping holes
- `{{ e }}` desugars to `esc(${e})` in parser.ml — a Call on the `esc`
  in scope, so types/owner/emit/.wob/VM are untouched
- WO-E004 unterminated raw literal; WO-E005 newline inside "..." —
  closes a hole where a missing quote silently ate the rest of the file
- wo-html: `Component` interface, `render_all`, `Layout`, README
- framework: `ok_html` joins ok_text/ok_json in http/types.wo
- site + shop restructured to one-feature-one-module MVC (view +
  controller per directory, model at the root, bootstrap-only main)
- removed the filler `pad: Int` convention — verified unnecessary for
  plain classes, interface dispatch, containers and actors
- corrected recorded claims: gap #1 blocks neither the build nor the
  layout; a class crosses module lines, only a free fn is scoped
- docs/guides/language-surface.md — the full grammar inventory
- story 37 landed and moved to done/

Gates: oop-accept MET, oop-e2e 116/0, woc-test 556/0, site 11/0,
web-app 46/0, fibers 10/0, db-actor 8/0

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 03:58:41 +02:00
..
.gitignore feat(examples): fibers — the hybrid scheduler demonstrated + gate 2026-08-20 10:00:40 +02:00
main.wo feat(lang+wo-html): raw text literals, component layer, MVC samples 2026-08-25 03:58:41 +02:00
README.md feat(examples): fibers — the hybrid scheduler demonstrated + gate 2026-08-20 10:00:40 +02:00
wo.toml feat(examples): fibers — the hybrid scheduler demonstrated + gate 2026-08-20 10:00:40 +02:00

fibers — the hybrid scheduler, demonstrated

The smallest program that shows all three legs of the concurrency model (the doctrine-depth writeup lives in docs/plan/exploration/fibers/00-fibers.md):

  1. Reduction-budget eviction — part 1's output is byte-exact and timing-free: main sends three messages, then burns reductions; every time its budget expires the counter actor gets a turn and delivers exactly one message. Cooperative mechanics, preemptive fairness.
  2. Actors as the spawn surface — spawn Counter { ... } returns an actor Tick; send moves the message (using it afterwards is a compile error); delivery is one message at a time per actor.
  3. Parking, not blocking — part 2's sleeper actor calls time.sleep mid-receive: the fiber parks on the shard's I/O plane (io_uring primary, epoll fallback — WO_IO=uring|epoll forces either) and main keeps ticking while it sleeps.

Run: just fibers (the acceptance gate builds it, checks part 1 byte-exact, asserts part 2's ordering invariants, and repeats the run on both I/O backends plus ASan).