Website | Source

Every value %-prefixed and typed at definition; one canonical way to express each operation; compiles to native via LLVM.

Camp: Syntactic
Author: Magpie Language Developers
Implementation language: Rust
Compilation target: LLVM IR / native, also WebAssembly
Licence: MIT
First seen: April 2026
Maturity: early implementation

Agent tooling:
- SKILL.md
- AGENTS.md

Key idea

The textual program is already in SSA form. Every binding is %-prefixed and typed at definition, basic blocks are explicit, branches and ownership transitions are first-class operations. The bet is that removing surface ambiguity reduces LLM error rates more than added verification does.

Thesis

Magpie is a syntactic-camp project that takes the camp's premise to its logical end: don't add verification, remove ambiguity. The site states the goal directly — "Magpie eliminates ambiguity so LLMs can write perfect code on the first try" — and the language realises it by making the textual program identical to the compiler's intermediate representation. Every value is named at the point of definition with a %-prefixed identifier, typed inline, and assigned exactly once. Basic blocks are explicit (bb0:). Branches are explicit (cbr, br). Ownership transitions (borrow, mutborrow, share) are first-class operations. The premise is that the hidden semantics of conventional syntax — operator overloading, implicit conversions, invisible lifetime rules — are exactly the places LLMs hallucinate.

~2.3× more tokens per operation, but eliminates the hidden rules that cause AI retries and borrow checker failures.

The distinctive move shows up in the cross-camp comparison with Vera. Vera adds verification on top of conventional surface syntax (mandatory contracts, Z3 discharge, the <Inference> effect). Magpie strips the surface itself. Vera says "let the compiler catch what the model gets wrong." Magpie says "don't give the model anywhere to be wrong in the first place." NERD takes a similar diagnosis on the syntactic side but bets on minimal English-like tokens; Magpie bets on machine-style explicit SSA.

What it looks like.

module demo.main
exports { @main }
imports { }
digest "0000000000000000"

fn @add_two(a: i64, b: i64) -> i64 {
bb0:
%sum: i64 = i.add { lhs=%a, rhs=%b }
ret %sum
}

Every value is %-prefixed, typed at definition, and computed by a named operation with named operands.

Distinctive moves

Maturity

A Rust workspace at v0.1: 44 commits, 3 stars, 1 fork, no releases, MIT-licensed, attributed in the homepage footer to "© 2026 Magpie Language Developers." The crate set covers lexer, parser, semantic analysis, type checking, ownership checking, an MPIR lowering with a verifier, ARC insertion, and codegen paths for LLVM-text and WASM. Benchmarks published on the site report a 155 ms compile time for the sample program against Rust's 234 ms and TypeScript's 268 ms, with execution speed matching Rust at 32 ms and peak memory at 1.6 MB against Rust's 1.4 MB and TypeScript's 69.2 MB. Diagnostics ship stable codes (magpie explain MPT2014) and JSON output (--output json/jsonl). The standard library is small; the surrounding ecosystem (LSP, registry, IDE plug-ins) doesn't exist yet. The bet is that a small, machine-shaped surface plus structured diagnostics will outperform conventional surface plus verification for first-try generation.

Agent tooling

The repository ships SKILL.md (a coding-and-diagnostic guide written for agents) and AGENTS.md alongside DOCUMENTATION.md and DOCUMENTATION_QUICKSTART.md. The CLI exposes magpie mcp serve, magpie memory build/query, and magpie ctx pack for agent workflows; --output json and --output jsonl modes emit structured diagnostics with stable codes. Token-efficiency claims live in BENCHMARK.md.

Design DNA


Tags: language   ai   syntactic   llvm   web assembly  

Last modified 15 June 2026