Mighty — Agent-first systems programming language
An agent-first systems programming language. Statically typed, ownership-based, with first-class agents, protocols, capabilities and effects. Compiles to native + WebAssembly.
A small program, a real compiler.
mty new scaffolds a project. mty check runs the full pipeline — lex, parse, lower, type-check, borrow-check. mty run JITs via Cranelift, with a tree-walking interpreter as fallback.
fn main() {
log("hello, Mighty")
}A real compiler stack, not a toy.
Type system
Hindley–Milner inference with bidirectional checking. Generics with monomorphization, trait dispatch, dyn Trait fat pointers. ? propagation for Result. Effect system + capabilities (fs, net, time, rand, model). Formal Sendable trait for cross-agent message soundness.
Ownership & borrow
Ownership + move + borrow + affine + arena tracking. Field-level borrow Places with NLL last-use deactivation — the borrow checker that knows when you're done.
Concurrency
Tokio-backed runtime with mailboxes, supervisors, deadline timers. Multi-core scheduler with per-worker tokio runtimes, crossbeam-deque work-stealing, affinity hints. Cooperative mid-turn cancellation. Deterministic-execution mode. Per-handler memory + tick budgets.
Codegen
Cranelift JIT + AOT object emission by default. LLVM backend behind --features llvm. Wasm core module + Component Model emission via wit-component. DWARF v4 debug info, Wasm source maps, and a name section.
Tooling
mty lsp ships an LSP 3.17 server. mty pkg is a real package manager: resolver, lockfile, GitHub-Releases registry, signed sidecars. mty doc generates markdown/HTML with a search index. mty fmt is idempotent under fuzz.
Self-hosting
Lexer, ~1.9 KLOC parser subset, HIR lowering, minimal typeck, and MtyIR lowering are written in Mighty itself, exercised against examples 01–05. 40 self-host tests passing. A pure-Python second front-end lives in impl-py/ — 135 tests, 20/20 examples.
Build from source.
There is no released binary yet — Mighty is pre-alpha. MSRV is Rust 1.85. Treat the language as unstable, and file issues for everything that surprises you.
github.com/hassard0/Mighty →cargo install --git https://github.com/hassard0/Mighty mty-cli
mty new hello && cd hello
mty run src/main.mty
# → hello, MightyOne binary, mty.
| mty check | lex, parse, lower, type-check, borrow-check |
| mty run | JIT via Cranelift (interpreter fallback) |
| mty build | native object + linker, or --target wasm32-wasi |
| mty fmt | canonical Wadler/Lindig formatter |
| mty dump --sir | inspect the mid-level IR |
| mty explain MTxxxx | one-paragraph explanation of any diagnostic |
Spec frozen at RC2. Three blockers.
- 01A second independent compiler implementation (RFC-007).
- 02The six RFC 30-day comment windows (RFC-001…RFC-006).
- 03A published normative conformance suite.
Proposed freeze date — 2026-09-01.
On the longer horizon.
- — Lossless live agent migration; per-message work-stealing.
- — Polonius-style borrows; real cap-name resolution wiring.
- — WASI Preview 2 + user-supplied WIT; DWARF v5.
- — Effect-row polymorphism.
- — Distributed agents; PGO / ThinLTO.