- language: `spawn Cls { fields }` expression (ctor semantics — fields
MOVE; result is the address); `actor M` parametric field type
(contextual like multi/map — actor stays a legal identifier); `send`
is a builtin free-fn name, not a keyword (shadowing rule applies)
- typing: M inferred from Cls's receive(msg: M); WO-E221 when receive
is missing, mis-armed, or M is not a class/record/union; send checks
addr is `actor M` and the message IS an M (silent when underivable);
ctor half of spawn delegates to the Ctor arm (completeness, ?T, E207)
- ownership: send's message TRANSFERS (sender's later use = WO-E301,
corpus-pinned); spawn's fields move via the ctor machinery; an
address is Copy
- emit: spawn lowers to ctor + LOADK receive's method index + BUILTIN
68; send is BUILTIN 69 with the message excluded from fresh-arg drops
(the runtime owns it now)
- runtime: wo_actor (moved-in instance, receive idx, growable FIFO
mailbox, one delivery fiber at a time); delivery reuses the fiber
context across messages and re-queues per message (fairness — an
actor never monopolizes); the runtime drops each message after its
receive returns; actor state/queued/in-flight messages are GC roots;
teardown drops everything (main-return reap included); loader knows
the two arities
- corpus: run/actor-echo (typed spawn/send, one-at-a-time delivery
interleaved with main by budget — output exact, ASan-clean),
compile-fail/spawn-no-receive (WO-E221), send-after-move (WO-E301)
- battery green: oop-e2e 92/0, woc-test, wovm-test, log-watcher 7/0,
employee 8/0, web-app 21/0, deps-accept 8/0
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| actor | ||
| compile-fail | ||
| db | ||
| gc | ||
| lang | ||
| run | ||
| sample-logwatcher | ||
| sys | ||
| trap | ||
| README.md | ||
tests/corpus/ — the conformance spine
Fixture kinds, exact-outcome matching (byte-equal stdout / exact WO-E### / exact trap code / exact gc step+freed counts):
| dir | kind | landed by plan |
|---|---|---|
run/ |
compiles + runs, expected stdout | 3 |
compile-fail/ |
must fail with expected WO-E### |
3–4 |
trap/ |
must trap with expected code | 3–4 |
gc/ |
cycle collection scenarios | 3 |
actor/ |
shard/spawn/send (ASan+TSan) | 4 |
db/ |
insert/select + crash/replay | 5 |
lang/ |
Haxe-parity adoptions | 8 |
sys/ |
fs/proc/net/time/json stdlib | 9 |
sample-logwatcher/ |
ported log-watcher fixtures | 10 |
Runner: scripts/oop-e2e.sh (plan 3, task 2 — includes the how-to-add-a-fixture doc pointer docs/plan/oop-vm/02-corpus.md).