Wings VM
English | 简体中文 · Website & Docs · crates.io
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, typed nullablepid<Actor>handles,if / elsebranching,whileloops, bounded direct and mutual recursion within managed stack frames, and a lightweightwings-lsplanguage server (diagnostics, hover, goto-definition, references, document symbols, rename, completion). - 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 bitmap mark-sweep GC with inline single-buffer storage (
BufferStorage::One), O(1)slot + generationcapability addressing (Slot <= 64 B), pooled reusable coroutine stacks with zero-stack direct spawn, segmented cache-line-partitioned lock-free fast mailboxes (SharedMailboxInner <= 448 B, 64 BEnvelope), multi-worker preemptiveSchedulerwith zero-alloc intrusive ready lists, three-level (VM -> Tenant -> Process, 128 BAccountNode) resource admission, and zero-RMW global Rust allocator + OS process memory accounting (WingsAllocator/native_memory_ledger). - Bundling & Network Serving: Multi-actor bundling via
wings-compile build-app, and event-driven non-blockingReactorserving (nativekqueue/epoll+ slab connection indexing + reply wakeup pipe +Condvargraceful drain) viawings-vm serveoverstdio,--tcp(JSON Lines), and--http(JSON-RPC +GET /healthz,/metrics,/faults). - Paired BEAM Benchmarks & Known Boundaries: The manual workflow runs
hot-queue,sparse-256(10,000 actors),mixed-4k, andfairnesson Linux x86-64 under a hard 2-vCPU quota and on macOS Arm64. See Evaluation & Acceptance for the latest CI results, methodology, and bare-metal sign-off. OS loader metadata outside the Rust allocator is measured at process scope; multi-file imports and declarative supervision remain on the 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
# Inspect checks selected for staged, unstaged, and untracked changes
# Run selected checks; reuse successful local results when inputs are unchanged
# Include committed branch changes relative to main
Routine CI uses the same incremental scheduler. Full dual-platform, MSRV, and AOT checks run manually through release.yml before publishing; paired BEAM benchmarks remain a separate manual workflow. See Evaluation for scope and cache rules.
Documentation
中文读者请参阅 简体中文 README 及 docs/zh/ 目录下的完整中文文档。
| Document | 中文文档 | Summary |
|---|---|---|
| Product Positioning | 产品定位 | Performance & memory targets, target workloads, and trade-offs vs. BEAM / Tokio / Wasmtime |
| Architecture | 架构设计 | 11-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, dual-platform CI results, 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.