v0.49 · spec v1.0-RC5 — pre-alpha

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.

Hello, Mighty

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.

src/main.mtyMIGHTY
fn main() {
  log("hello, Mighty")
}
Features

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.

Install

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.

$ shellMSRV 1.85
# 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 --watch
The CLI

One binary, mty.

mty checklex, parse, lower, type-check, borrow-check
mty runJIT via Cranelift (interpreter fallback)
mty buildnative object + linker, or --target wasm32-web
mty servedev server + http + websocket reload on file change
mty new --template web-gamescaffold agent + canvas + dom-shim project
mty fmtcanonical Wadler/Lindig formatter
mty inspectlive agent snapshot via runtime control socket
mty replay --byte-identicaldeterministic re-execution from a trace
mty reload <agent> --from new.wasmhot-reload, mailbox preserved
mty test --evalrun *.eval.mty suites against a provider panel
mty fix --applypipe `mty check --format json` in; apply top-confidence fixes
mty findcapability-tagged stdlib search across 564 catalog entries
mty agentNDJSON CLI protocol (9 ops) over stdio / HTTP / unix socket
mty explain MTxxxxone-paragraph explanation of any of 81 diagnostics
~4,227
combined tests (~3,555 Rust + 490 Python + 159 conformance + 23 selfhost), 0 failing
564
stdlib catalog entries across 33 modules, surfaced through LSP hover + mty find
3
independent implementations (Rust + Python full pipeline + Go front-end)
v1.0-RC5
spec frozen — proposed freeze 2026-09-01, earliest tag 2026-07-26
To v1.0

One blocker left.

  1. 01Python 2nd-impl through the full pipeline — closed in v0.22.
  2. 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.
  3. 03Normative conformance suite — 159 cases / 24 categories, shipped.

Proposed freeze 2026-09-01 · earliest tag 2026-07-26.

Latest in v0.49

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.

Dogfooded — Mighty IDE

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
src/main.mty — mighty-ide
// 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
Vello renderer·Rust shim, Mighty orchestration·3 live themes