Wings compiles the statically typed, immutable-value language wings-lang ahead-of-time into native machine code with compiler-enforced safepoints and exact GC roots—combining BEAM-grade fault isolation, preemptive fairness, and three-tier resource quotas with compact native value layouts.
struct Command { session_id: int, prompt: str }
struct Reply { session_id: int, turn: int, output: str }
actor Worker {
state turns = 0
on step(cmd: Command) -> Reply {
turns += 1
Reply {
session_id: cmd.session_id,
turn: turns,
output: f"s{cmd.session_id}#{turns}:{cmd.prompt}",
}
}
}
actor Supervisor {
state worker: pid<Worker> = null
state restarts = 0
on boot -> bool {
if worker.is_null() {
let child = spawn(Worker)
worker = child
child.monitor(on_down)
send_after(1000, tick(1))
}
true
}
on tick(n: int) { /* periodic heartbeat */ }
on on_down(dead: pid<Worker>, reason: int) {
if dead == worker && reason != 0 {
restarts += 1
let next = spawn(Worker)
worker = next
next.monitor(on_down)
}
}
} # 1. Static type, state & protocol verification
$ wings-compile check examples/session-service.wings
# 2. Emit native AOT bundle (Cranelift 0.118 + ShadowFrame GC roots)
$ wings-compile build-app examples/session-service.wings -o target/session-bundle
# 3. Launch preemptive multi-worker HTTP JSON-RPC server
$ wings-vm serve --trusted target/session-bundle --workers 4 --http 127.0.0.1:8080
# 4. Dispatch typed actor message & inspect health
$ curl -s http://127.0.0.1:8080/healthz
{"ok":true,"status":"ready","workers":4} Dormant actors hold zero native stack, borrowing 256 KiB pooled stacks only while running
Direct slot index + generation guard prevents stale PID reuse after termination
Explicit ShadowFrame root chains, budget-polled mark-sweep, zero C-ABI unwind
Atomic VM → Tenant → Process reservation across 4 dimensions with clean rollback
Frontend semantics, AOT codegen, and runtime scheduling are co-designed around a narrow managed C ABI—making preemption, exact GC roots, and quota accounting deterministic.
Co-evolving language, compiler, and runtime—never sacrificing preemption or admission safety for synthetic benchmark numbers.
First-class actors, shared immutable structs, multi-state bindings, nullable pid<Actor>, str / bytes / [int], and bounded recursion—paired with non-blocking .ask(..., timeout, then) continuations and wings-lsp.
Automatically instruments loop backedges, calls, and allocations with reduction/stack checks and explicit ShadowFrame chains; per-process GC polls budget every 16 nodes with zero unwind across C ABI.
Suspended microprocesses hold zero native stack memory, borrowing 256 KiB pooled coroutine stacks or direct-stack fast paths on demand, backed by generation-bound lock-free fast mailboxes.
Reserves bytes, processes, messages, and requests across VM → Tenant → Process upfront; discards uncommitted state on fault, fires monitor notifications, and serves stdio / --tcp / --http.
Trading arbitrary third-party native crate linking inside actors for compact static layouts, compiler safepoints, and exact per-actor memory accounting.
| Runtime | Execution Model | Preemption & Quota Boundary | Primary Engineering Trade-Off |
|---|---|---|---|
| Native Rust Actors (Tokio) | Unrestricted native code | Cooperative yield only; no automatic loop preemption or per-actor heap ledger | Peak raw throughput, but fairness, memory containment, and state isolation rely on developer discipline |
| WASM Actors (Wasmtime) | JIT / AOT linear-memory sandbox | Hardware/trap isolation designed for untrusted multi-tenant code | Per-instance linear memory, tables, and host marshaling add overhead for millions of tiny sessions |
| BEAM (Erlang / Elixir) | JIT bytecode VM | Battle-tested per-process heaps, reduction preemption & OTP supervision | Dynamic tagged words and dispatch leave headroom in dense session and compute-mixed workloads |
| Wings VM | Managed wings-lang Native AOT | Compiler safepoints + exact GC + 3-tier admission ledger | Purpose-built for trusted first-party workloads (--trusted) needing high session density & fault containment |
Every paired benchmark and memory ledger claim states its exact host environment, CPU quota, and remaining boundaries.
Rendered directly from docs/ in the repository—concise, concrete, and free of marketing hype.
Performance and memory density goals, baseline trade-offs vs. BEAM / Tokio / Wasmtime, target workloads, and explicit non-goals.
10-crate workspace dependency isolation, Cranelift AOT pipeline, managed C ABI boundary, and precise CFG root liveness.
actor / struct / state syntax, static immutable value types, non-blocking ask/tell, send_after timers, and monitor notifications.
O(1) slot+generation capability handles, pooled coroutine stacks, chunked precise GC, lock-free mailboxes, M:N preemption, and 3-tier admission.
Incremental development checks, manual release verification, paired BEAM workloads, and measurement discipline.
0.0.x zero-baggage evolution policy, status of technical slices 1–7, primary engineering risks, and M1–M5 milestones.
Apache-2.0 licensing, daily incremental CI, manual pre-release gates, topological publish order, and release history.