Wings VM
English | 简体中文
A managed AOT microprocess virtual machine for high-concurrency stateful applications.
Wings implements its runtime in Rust and compiles wings-lang business logic ahead-of-time (AOT) into managed native machine code via Cranelift. Its goal is to deliver higher sustained throughput and lower memory footprint than BEAM under identical stateful workloads, while preserving message isolation, preemptive fairness, hierarchical resource quotas, and fault recovery.
- Throughput Goal: Achieve higher sustained throughput under identical CPU quotas and tail-latency (p99 / p999) constraints.
- Memory Goal: Lower total machine memory footprint and raise single-node process density under identical session state, mailbox depth, and active ratios.
- Primary Platforms: macOS AArch64 (Apple Silicon) and Linux x86-64.
[!IMPORTANT] Early-Stage Notice (
0.0.x): Wings is under rapid early iteration with no backward-compatibility guarantees. Language syntax, the managed C ABI, artifact manifests (manifest.json/bundle.json), CLI flags, and Rust APIs may change with breaking updates—always recompile.wingssources after upgrading.
Current Capabilities
- Language & Frontend (
wings-lang): Supportsactorand top-level/local immutablestructtypes, multiplestatebindings,int/bool/unit/[int]/bytes/str, typedpid<Actor>and nullablepid?<Actor>,if / elsebranching,whileloops, bounded direct and mutual recursion within managed stack frames, and a lightweightwings-lsplanguage server. - Actor Messaging & Fault Tolerance: Supports
spawn(Actor), one-way messaging (!/.tell), non-blocking requests with timeout callbacks (.ask(..., timeout: ..., then: ...)), delayed self-timers (send_after), and lifecycle exit notifications (monitor). - Compiler & Runtime: Precise CFG-based GC root liveness analysis, per-process chunked non-moving mark-sweep GC, O(1)
slot + generationcapability addressing, pooled reusable coroutine stacks, lock-free fast mailboxes, multi-worker preemptiveScheduler, and three-level (VM -> Tenant -> Process) resource admission. - Bundling & Network Serving: Multi-actor bundling via
wings-compile build-app, and network/IPC serving viawings-vm serveoverstdio,--tcp(JSON Lines), and--http(JSON-RPC +GET /healthz). - Open MVP Gates: Multi-file module imports and declarative supervision trees are not yet implemented; dynamic loader / system allocator overhead is not yet fully closed in the three-level ledger; and the dual BEAM gates on hot-queue open-loop service p99 and Linux cgroup v2 hard CPU quotas remain in progress (see Evaluation & Acceptance and Risks & Roadmap).
Quick Start
Prerequisites: Rust 1.85+ and a system C linker (cc, overridable via CC). Install the CLI toolchain directly from crates.io:
1. Static Check & Single-Actor Execution
# Static syntax, type, and protocol check
# Build a single-actor native AOT artifact (output directory must not exist)
# Execute a JSON Lines message stream (--trusted is for trusted local builds only)
2. Multi-Actor Application Bundle & Serving
# Compile a multi-actor bundle (includes supervision restart and heartbeat timers)
# Start a multi-worker HTTP server (POST /<handler> and GET /healthz)
# Or start a TCP JSON Lines server
3. Development & Verification Commands
# Build binaries & examples and run the full end-to-end AOT verification suite (requires Python 3)
Documentation
中文读者请参阅 简体中文 README 及 docs/zh/ 目录下的完整中文文档。
| Document | 中文文档 | Summary |
|---|---|---|
| Product Positioning | 产品定位 | Performance & memory targets, target workloads, and trade-offs vs. BEAM / Tokio / Wasmtime |
| Architecture | 架构设计 | 10-crate workspace isolation, Cranelift AOT pipeline, managed C ABI, and precise GC |
| Language Design | 语言设计 | wings-lang syntax, immutable value types, async messaging, timers, and monitors |
| Runtime | 运行时 | Microprocess layout, stack pooling, lock-free mailboxes, M:N preemption, and 3-level quotas |
| Evaluation & Acceptance | 评测与验收 | Paired BEAM benchmarks, current macOS AArch64 measurements, and optimization discipline |
| Risks & Roadmap | 风险与里程碑 | 0.0.x evolution policy, technical slices 1–7, known risks, and M1–M5 milestones |
| Crate Publishing | 包发布 | Apache-2.0 license, topological crates.io release order, and release history |
Before contributing code or documentation, please review AGENTS.md.