Mo vs MoonBit

One line: the closest shipping competitor to Mo’s premise (direction 1): a language plus toolchain plus built-in agent, company-backed and heading for 1.0. On the list to be specific about what it does, what its language looks like, and what the evidence says about agents writing a language with almost no training data.

What it is (status as of Sep 2026)

MoonBit launched in October 2022, alongside ChatGPT. It was conceived as a whole platform: IDE, compiler, build system, package manager.[80] v0.10.0 (June 2026) is “an important step before the official 1.0 release”, with 1.0 targeted for Q3 2026.[82] v0.10.9 shipped on 19 August.[83] Native code uses Perceus reference counting, and JavaScript and WebAssembly are the other targets.[85] A secondary report says the team is based in China and the Mooncakes registry has passed 10,000 libraries and 4 million downloads.[89]

The ideas, one by one

  • The language: Rust-shaped, flat, typed errors. Top-level definitions require type signatures. Interfaces are implemented structurally, outside the type’s block, so a model can generate code “nearly linear[ly]” without jumping back up the file.[80] Errors are declared in the signature with raise and handled with try/catch.[86]

    suberror DivError { DivError(String) } derive(Debug)
    fn div(x : Int, y : Int) -> Int raise DivError {
      if y == 0 { raise DivError("division by zero") }
      x / y
    }
    • Mo today: types are required at every boundary (direction 11). Result plus a try prefix, and no catch (pick 6, direction 18). No braces (pick 1).
    • Verdict: already have mandatory signatures, for the same agent reason. Reject raise/catch. MoonBit’s own notes show the cost. Cancellation is signalled by a special error that “can be accidentally caught or transformed, causing the program to misbehave”.[83]
  • A semantics-aware sampler. While a model generates, a local sampler keeps tokens syntactically valid and a global sampler checks types. A speculation buffer backtracks on a bad token. MoonBit reports “a significant improvement in compilation rates, with a modest performance penalty of approximately 3%”.[80][81]

    • Mo today: a fast tier-1 checker (Q8) and structured diagnostics (Q9). No decoding-time integration.
    • Verdict: open. This works only where the toolchain controls sampling, which means local or self-hosted models, not hosted APIs.
  • MoonBit Pilot: the agent inside the toolchain. MoonBit calls it “part of the language itself”. Pilot generated a TOML parser, an ini parser and a Lisp interpreter “without human input”, repairing the code from toolchain feedback. Those libraries are then reused “as training data for the next generation of base models”.[79] It uses semantic search instead of grep. Sub-agents plus “native code segmentation” let fixes run in parallel.[79] The vendor’s own benchmark: 126 warning fixes in about 7 minutes, against 35 minutes (partial) for Codex CLI and a tool-limit stop at 16 minutes for Cursor.[79] Code embedded in .mbt.md docs is checked too.[79]

    • Mo today: edits by declaration ID, stable IDs as the join key for diagnostics (Q10, direction 29).
    • Verdict: already have the enabling design, since declaration IDs are Mo’s “native code segmentation”. Reject shipping Mo’s own agent; ship agent-facing tools instead (see unison). Steal the corpus loop: toolchain-verified, agent-written libraries become training data.
  • SeekMoon: from IDE to “ADE” (Sep 2026). The developer sets a goal and the agent edits. Review uses Token Diff (formatting de-emphasized) and Syntax Tree Diff (extract-function and rename shown as structure). Syntax-tree search results can be added to the agent’s context.[84]

    • Mo today: humans read at spec altitude (direction 2) and are pulled in when the shape changes (direction 20).
    • Verdict: steal the idea of a structure diff, narrowed to a shape diff: show only changes to pub signatures, contracts, never and capabilities.
  • Several backends, Perceus on native. One codebase targets native, JS and Wasm, and packages declare supported_targets.[85] Value types (#valtype) avoid heap allocation. On MoonBit’s own FFT benchmark (Apple M1 Pro), it ran 33% faster than Rust.[88]

    • Mo today: Perceus (direction 10), C via Zig, WASM deferred (direction 24).
    • Verdict: already have the memory bet. MoonBit is a second shipping Perceus-native compiler, after Koka (koka). Treat the Rust comparison as a vendor number, and a disputed one (see Evidence).

What it gives up

  • A familiar reading surface for Robert’s taste. Braces, ->, :: paths (HttpResponse::ok()) and let mut,[85][86] all of which Mo rejected (syntax-overview).
  • Stability, until 1.0. 0.10 changed trait/impl syntax and relied on moon fmt to migrate code.[82] That is the gofix pattern from go, used in anger.
  • Simple error flow. A higher-order function has to be polymorphic in whether its argument raises (f : (T) -> T raise).[86]

Evidence

  • Zero-shot is near zero on hard tasks. The study (reported as accepted to IEEE TSE[89]) counts about 400 MoonBit repositories on GitHub.[90] With GPT-4o, MoonBit scored 12.60% on HumanEval and 0.88% on McEval-Hard, against 91.23% and 77.67% for Python. The authors: no-resource languages score “below 20% in most cases, and close to 0% for hard coding tasks”.[90] Further pre-training on the little data available helped most.[90] A secondary report quotes 32.60% (MoonBit) against 26.08% (Gleam) for a tuned Qwen model.[89] That figure was not found in the extracted paper text.
  • With a toolchain loop, agents build real systems. SWE-AGI has 22 specification-driven MoonBit tasks: parsers, protocols, a JS front end. Every agent solved all 6 easy tasks. GPT-5.3-codex solved 19 of 22, Claude Opus 4.6 15, Opus 4.5 10.[91] One failed run took 42 hours and wrote more than 30,000 lines.[91]
  • Sampler: better compile rates at about a 3% speed cost.[80]
  • Pilot vs Cursor and Codex: vendor-run and not independent.[79]
  • “Faster than Rust” on FFT: rebutted. Chris Allen calls the claim “a lie by omission”: the benchmark used a weak Rust baseline. His corrected Rust is 3.2–3.4× faster than MoonBit, and a Rust version GPT-5 wrote in five minutes was 2.33× faster. PRs fixing the baseline sat unmerged for about two weeks.[150] Per Robert’s agent-languages run, a Hacker News commenter attributes the original gap to mimalloc.[137]
  • Verification: a secondary source says the toolchain includes Hoare-triple verification.[89] It was not confirmed from a MoonBit primary source this pass.

What Mo should take from this

  • The bet holds, with a condition. Zero-shot code in a new language is nearly useless on hard tasks.[90] Agents working against specs, public APIs, hidden tests and a fast compiler still finish most real systems.[91] So Mo’s toolchain loop (Q9, Q8) is necessary before any corpus exists.
  • Proposal: use SWE-AGI’s task format for Mo’s eval suite. A fixed pub API with contracts, reference specs, public tests, and hidden tests. It is direction 19 as a benchmark.[91]
  • Proposal: a shape diff review view that shows only spec-altitude changes, the human-facing half of direction 20.[84]
  • Proposal: seed the corpus (done, session 5) with agent-written, toolchain-verified libraries, as Pilot does.[79]
  • Question for Robert: does Mo ship its own agent (MoonBit’s route) or only tools that any agent drives (MCP, Unison’s route)? Recommendation: tools only.
  • Evidence for direction 18: a catchable cancellation error caused misbehaviour in MoonBit’s own async library.[83]
  • Risk: MoonBit may already have contracts or verification, per the unconfirmed secondary claim.[89] Mo’s differentiation (spec altitude, capabilities, verification tiers, supply chain) needs a primary-source check before the v0 design doc.

Sources

[79] https://www.moonbitlang.com/blog/intro-moonbit-pilot — Introducing MoonBit Pilot (2025) [80] https://www.moonbitlang.com/blog/moonbit-ai — Exploring the design of an AI-Native Language Toolchain (MoonBit, 2024) [81] https://conf.researchr.org/details/icse-2024/llm4code-2024-papers/9/MoonBit-Explore-the-Design-of-an-AI-Friendly-Programming-Language — MoonBit: Explore the Design of an AI-Friendly Programming Language (Fei et al., LLM4Code@ICSE 2024) [82] https://www.moonbitlang.com/updates/2026/06/08/moonbit-0-10-0-release — MoonBit v0.10.0 release (Jun 2026) [83] https://www.moonbitlang.com/updates/2026/08/19/index — MoonBit v0.10.9 release (Aug 2026) [84] https://www.moonbitlang.com/blog/seekmoon-from-ide-to-ade — SeekMoon: From IDE to ADE (MoonBit, Sep 2026) [85] https://www.moonbitlang.com/blog/moonbit-multiple-targets — One Language, Multiple Targets (MoonBit, 2026) [86] https://docs.moonbitlang.com/en/latest/language/error-handling.html — MoonBit docs: Error handling [88] https://www.moonbitlang.com/blog/moonbit-value-type — Value type and bits pattern in MoonBit (2025) [89] https://robotsatlas.com/posts/moonbit-jezyk-programowania-pod-ere-ai-z-chin — MoonBit: a language designed for the AI era (Robots Atlas, 2026) [90] https://arxiv.org/abs/2606.16827 — No Resource, No Benchmarks, No Problem? Evaluating and Improving LLMs for Code Generation in No-Resource Languages (accepted IEEE TSE) [91] https://arxiv.org/abs/2602.09447 — SWE-AGI: Benchmarking Specification-Driven Software Construction with MoonBit [137] raw/research-runs/llm-authored-programming-languages.pplx.md — Robert’s research run: LLM-Authored Programming Languages, evidence base 2023–2026 (Perplexity, landscape prompt 3) [150] https://bitemyapp.com/blog/moonbit-developers-are-lying-to-you — MoonBit developers are lying to you (Chris Allen, Sep 2025)