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. Effect system + capabilities (fs, net, time, rand, model). Effect-row polymorphism (Koka/Eff-style) with !{a, b | E} surface syntax. Hygienic macros via set-of-scopes resolution. 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. Opt-in Polonius-style second-pass borrow checker behind --features polonius — datalog fact model + 4 inference rules + fixpoint solver, byte-identical to NLL on default builds.
Concurrency
Tokio-backed runtime: mailboxes, supervisors, deadlines, budgets. Per-message work-stealing with NUMA-locality steal ordering. Cluster mesh: cross-node send/ask over framed CBOR + mTLS, ClusterSupervisor with OneForOne/RestForOne/OneForAll restart strategies + per-child circuit breakers.
LLM agent stdlib
std.llm — typed Anthropic / OpenAI / Gemini / Bedrock providers with streaming, tool use, structured outputs, TokenBudget, and multi-modal vision-language Image input across all four. @tool(description, cap) generates JSON schema for every provider; cap: enforced by the runtime. std.mcp server (stdio + http) auto-exposes annotated tools; client connects to other MCP servers. std.computer + @computer_use ship Anthropic Computer Use as a capability with typed sandbox bounds.
RAG, swarm, memory, eval
std.rag is RAG-as-stdlib — Index + Retriever + Reranker + Pipeline over vector / sparse / hybrid stores. std.swarm votes consensus across providers under a shared dollar budget (Majority / Plurality / Unanimous / Weighted). std.memory ships VectorStore + Episodic + Working, snapshots fold into replay. std.eval is a typed Suite / Case / Member / Compare regression harness on top of byte-identical replay; mty replay --diff finds the first divergent turn.
Agents, live
mty inspect surfaces mailbox depth, in-flight handler, budgets, and last-N messages over an opt-in control socket. OpenTelemetry spans for spawn / send / ask / handler / restart / budget-exhausted. std.observe + mty inspect --cost auto-record every LLM call's cost + latency in local SQLite. mty agent exposes a structured NDJSON CLI protocol (9 ops) over stdio, HTTP/1.1 or Unix socket — agents drive every mty subcommand without scraping human output.
Distributed + migration
Cross-node send/ask (AgentAddr = node:type:pid) over framed CBOR-over-TLS. Lossless live agent migration (RFC-006): MigrationOrchestrator ships snapshot + queued mailbox + continuation between nodes with PlacementPolicy trait (Sticky / LeastLoaded / Static). Hot reload via Resumable + ReloadGate, mailbox preserved across the swap. MT507x diagnostic band, OTel cluster metrics.
Codegen
Cranelift JIT + AOT object emission by default. LLVM behind --features llvm. WASI Preview 2 default for wasm32-wasi — std.fs / std.http / std.random / std.time / log() emit direct versioned P2 imports. wasm32-web target emits a real Component-Model component with std.web.Canvas + std.web.Input WIT. DWARF v5 per-instruction line program (opt-in via MTY_DWARF5=1). PGO + ThinLTO via release-pgo + BOLT layout optimisation on linux-x86_64. Full extern-c FFI matrix with [[extern_lib]] manifest entries.
Tooling
mty lsp ships LSP 3.17 with hover, completion, go-to-def, semantic tokens, rename, inlay hints, code actions, signature help — across 564 stdlib catalog entries spanning 33 modules. One-click LSP CodeActions on every diagnostic (81 MTxxxx codes); source.fixAll.mighty bulk-applies preferred-confidence fixes. mty pkg ships a real resolver, lockfile, GitHub-Releases-backed registry, sigstore-real signed bundles. mty dap debug adapter wired into both VS Code and JetBrains.
Editors + playground
VS Code extension (LSP + 44 snippets + cost status bar + cost CodeLens + cost webview). JetBrains plugin (IntelliJ / RustRover / PyCharm / WebStorm — Community + Ultimate). Tree-sitter grammar for Neovim / Helix / Zed. Reusable GitHub Actions composite workflows. Browser playground at hassard0.github.io/Mighty/playground — Monaco editor + the real Mighty parser+typeck+IR+interp shipped as a 1.15 MB wasm-pack artifact.
Self-hosting + 3 impls
Rust reference compiler (20-crate workspace, crates/mty-*). Python 2nd-impl through wasm codegen — 490 tests; 23/23 examples typeck clean, 21/24 emit wasm. Go 3rd-impl front-end (lexer + parser). Self-host bootstrap in Mighty: lexer, ~1.9 KLOC parser, HIR lowering, minimal typeck, MtyIR lowering, wasm core-module codegen — 23 driver codegen tests.
Grab a binary, or build from source.
Pre-built mty binaries for Linux x86_64, macOS arm64, and Windows x86_64 ship with every tagged release. Source builds need Rust 1.85+. The fastest on-ramp is mty new --template web-game + mty serve --watch — a 5-file agent + canvas project with websocket hot-reload. Treat the language as unstable.
# pre-built binaries: Linux x86_64/aarch64, macOS arm64/x86_64, Windows x86_64
# → github.com/hassard0/Mighty/releases
# (linux-x86_64 ships PGO + BOLT; windows-x86_64 ships PGO)
# or build from source (MSRV: Rust 1.85)
git clone https://github.com/hassard0/Mighty && cd Mighty
cargo install --path crates/mty-cli # Linux + macOS
cargo install mty --no-default-features --features cli-min # Windows
# or try it in the browser, no install — Monaco + real parser/typeck/IR/interp
# → hassard0.github.io/Mighty/playground/
# fastest on-ramp:
mty new --template web-game asteroids && cd asteroids
mty serve --port 8000 --watchOne 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-web |
| mty serve | dev server + http + websocket reload on file change |
| mty new --template web-game | scaffold agent + canvas + dom-shim project |
| mty fmt | canonical Wadler/Lindig formatter |
| mty inspect | live agent snapshot via runtime control socket |
| mty replay --byte-identical | deterministic re-execution from a trace |
| mty reload <agent> --from new.wasm | hot-reload, mailbox preserved |
| mty test --eval | run *.eval.mty suites against a provider panel |
| mty fix --apply | pipe `mty check --format json` in; apply top-confidence fixes |
| mty find | capability-tagged stdlib search across 564 catalog entries |
| mty agent | NDJSON CLI protocol (9 ops) over stdio / HTTP / unix socket |
| mty explain MTxxxx | one-paragraph explanation of any of 81 diagnostics |
One blocker left.
- 01Python 2nd-impl through the full pipeline — closed in v0.22.
- 02Eight RFC comment windows (RFC-001…006 + 008 + 009). All opened 2026-05-26; earliest close 2026-06-09, latest 2026-07-25. Three already implemented and awaiting procedural ratification.
- 03Normative conformance suite — 159 cases / 24 categories, shipped.
Proposed freeze 2026-09-01 · earliest tag 2026-07-26.
Agent-first, end-to-end.
- — std.rag — RAG-as-stdlib: Index + Retriever + Reranker + Pipeline over vector / sparse / hybrid stores.
- — Multi-modal vision-language Image input across all four LLM providers.
- — mty agent — NDJSON CLI protocol (9 ops) over stdio, HTTP/1.1, or Unix socket; record/replay byte-matches sessions.
- — mty fix --apply + source.fixAll.mighty — one-click and bulk fixes across 81 MTxxxx codes.
- — Browser playground — Monaco + real parser/typeck/IR/interp as a 1.15 MB wasm-pack artifact.
- — PGO + BOLT layout-optimised release binaries on linux-x86_64; PGO on windows-x86_64; full extern-c FFI matrix.
Post-v1.0 backlog empty. Next reach (v1.1+): cluster placement policies, multi-agent swarm primitives, MCP federation, expanded BOLT (Mach-O + PE/COFF), Ed25519 / X25519 / Argon2 / HKDF, RegexSet.
Eight comment windows. Public review on GitHub Discussions.
All discussions →- RFC-001First-class union ADTscloses 2026-06-25
- RFC-002Wasm Component Model wrappercloses 2026-07-25
- RFC-003Sandboxed proc-macro executioncloses 2026-06-25
- RFC-004Per-call FsCap manifest materialisationcloses 2026-06-25
- RFC-005Agent affinity front-end syntaxcloses 2026-06-09
- RFC-006Lossless live agent migrationcloses 2026-07-25
- RFC-008Effect row polymorphismcloses 2026-06-25
- RFC-009Set-of-scopes macro hygienecloses 2026-06-25
A native code editor for Mighty,
written in Mighty.
mighty-ide is a GPU-vector-rendered editor whose UI is drawn each frame as a Vello scene — smooth gradients, true rounded corners, soft drop shadows, wavy diagnostic underlines, anti-aliased text. Orchestration is Mighty source (src/main.mty) calling a Rust rendering shim across a scalar extern c ABI.
- — Multi-cursor, snippets, find & replace
- — Quick-Open, command palette, split editor
- — LSP hover · completion · rename · code actions
- — Live mty check diagnostics
- — Source control + per-hunk staging + blame
- — Test runner + DAP debugger
- — Streaming AI copilot + inline ghost-text
- — Run in Browser via wasm32-web
// the IDE itself, in Mighty
agent Editor {
state: Buffer
state: Vec[Cursor]
on key(k: Key) -> Effect!{fs, render} {
match k {
Ctrl('s') => self.save()?,
Ctrl('d') => self.add_next_match(),
_ => self.insert(k),
}
render.frame(self.scene())
}
}
extern "c" fn vello_present(scene: Scene) -> i32