Graydon Hoare releases Millipede, an LLM-built language experiment with verified compilation
state: seedheat: mediumuncertainty: mediumrelevance: highllm-oriented-programming formal-methods llm-robustnessGraydon Hoare
What is this?
On November 23, 2026, Graydon Hoare published Millipede, an experimental programming language and compiler implemented in Lean 4. Its GitHub README describes a low-level language for LLM-written programs, with restrictions and checks including finite time and space bounds, information-flow controls, contracts, and verified compilation. Hoare says most of the repository was written with LLM assistance; he also cautions that he cannot confidently assess many of its technical claims, and that the language is slow and produces bad code. The supplied sources do not independently verify its implementation or proofs.
Why it matters
Millipede is a concrete experiment in using LLMs not just to write software, but to help build a language that constrains what LLM-written software can do. If the approach proves sound and practical, it could lower the cost of applying formal methods and make stronger safety properties more accessible. For now, this is a research provocation rather than a usable tool: its author explicitly flags uncertainty about correctness and poor performance.
Current assessment
What is new: Hoare’s README presents Millipede as an experiment in designing programming languages for a world where LLMs are both the intended programmers and part of the threat model. It describes a Lean 4 embedded DSL with resource bounds, linear typing and borrows, information-flow controls, contracts and specifications, plus a compiler written in Lean with proof-backed lowering steps. These are project claims from the README, not independently confirmed results. Hoare says LLMs helped implement the project and reports roughly one week of agent work, about six hours of his supervision, and a codebase of around 60,000 lines of Lean; he estimates the subscription compute cost at about US$50, while noting the estimate depends on subsidized subscription pricing. He describes the result as a sketch, says he cannot confidently assess many of its claims, and cautions that it is slow and generates bad code. The supplied web results add no relevant corroboration or adoption evidence. The important implication is a possible shift in the economics of formal methods: if LLMs reduce the cost of building verified compilers and writing proofs, stricter languages may become feasible for more developers. Whether Millipede’s proofs are sound, its protections effective, or the approach useful beyond this experiment remains unresolved.
Measured heat
now 0 pts/hpeak 3 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 75h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion
How the heat travelled
pace: p32 vs 2088 stories at the 72h mark (now 75h old) — ahead of a100-inference-hillclimb (2.0x), behind agentfx-agent-animation-tool (0.7x)
Evidence (2) — ⭐ canonical anchor
| source | object | author | score | comments |
| 🟧 hn | Millipede: A small language made by LLMs to help LLMs resist LLMsRetrieved article excerptOpen article · Retrieved 2026-11-23T13:22:36.357840+00:00 # Millipede
## LLM notice
Most of this repo is written by an LLM. If this offends, close the tab and move on.
This readme is written by a human.
## Overview
This is an experiment in trying to answer the question "what should programming languages look like in the LLM era?" Meaning: a time when LLMs are the target program-writing audience, and also the threat model, and also the language implementers.
Some characteristics:
- Low level, imperative, linear typed with borrows, no panic or UB
- Lots of extra fiddly typing disciplines
- Finite time & space bounds, no heap
- Interface/implementation split, with contracts and specs
- Typestates, session types, unit checking, information flow control, etc. etc.
- Implemented as a deep [embedded DSL](https://github.com/graydon/millipede/blob/main/doc/design/embedding.md) in Lean 4
- Each definition [elaborated](https://github.com/graydon/millipede/blob/main/Millipede/Meta/Elab.lean) to a [Core](https://github.com/graydon/millipede/blob/main/Millipede/Core/Exp.lean) term and a related Lean function (and some other stuff)
- Core term [denotation](https://github.com/graydon/millipede/blob/main/Millipede/Core/Denote.lean) then auto-proved extensionally equal to Lean function
- Lean used for specifying and proving correctness properties of either object (vcgen, grind, etc.)
- Lean used for anything higher order or polymorphic
- Core term used for the algorithmic, monomorphic inner programs
- Proofs about space, time, linearity etc. use Core term
- Core term compiled independently of normal Lean compilation path
- [Verified compilation](https://github.com/graydon/millipede/blob/main/Millipede/Top/Compile.lean) through a sequence of [lowerings](https://github.com/graydon/millipede/blob/main/Millipede/Compile/Lower.lean) with [memory refinement](https://github.com/graydon/millipede/blob/main/Millipede/Compile/LowerSound.lean) and [forward simulation proofs](https://github.com/graydon/millipede/blob/main/Millipede/Compile/Sem.lean) relating each layer's semantics. The compiler is written as a Lean function from Core terms to loadable OS object-file bytes: no LLVM or host toolchains are involved.
## Ignorance caveat
**I cannot say with high confidence how close to reality any of the above characteristics are.**
This repo wasn't just written by an LLM to save time, but also because I literally couldn't have written it myself. Most of the theorems much less proofs are over my head. I'm trying to understand what is here, and part of this exploration is the question of how to relate to work I'm *guiding* while not fully understanding what it's doing. I expect this phenomenon to get worse.
I did do the following with the LLM:
- Asked for, and discussed the implementation of, all of the above characteristics.
- Had it do random differential testing between several pairs:
- Core term translations and the Lean functions.
- Executions and the computed cost models.
- The machine environment model and qemu emulator / host machine states.
- Had it do mutation testing at each stage of the lowering.
- Had it do rounds of skeptical self-review and criticism about proof style, content, vacuity and triviality, etc. from the perspective of a person who believes LLMs only produce useless lies.
- Read a decent portion of the output for a couple days to convince myself it wasn't all lies.
I know all this has the distinct smell of writing "don't make mistakes" in the prompt, and for that I apologize. It is truly unclear to me how to do QA on something I substantially don't understand. I am trying my best.
I am not providing this as a suggestion for anyone to rush out and use (it's slow and generates bad code) or even necessarily spend any of their precious time on earth trying to review for correctness. I will keep doing that part myself. I offer it more as a sketch, perhaps a provocation to other PL people who know this landscape better than me to try something similar but better, and mainly just a concrete answer to a question I keep getting asked.
## Navigation
### Implementation
- Design docs: [doc/design/README.md](https://github.com/graydon/millipede/blob/main/doc/design/README.md)
- Codebase & theorem tour: [doc/guide/tour.md](https://github.com/graydon/millipede/blob/main/doc/guide/tour.md)
- Status of work and claims: [doc/status.md](https://github.com/graydon/millipede/blob/main/doc/status.md)
- Roadmap: [doc/roadmap.md](https://github.com/graydon/millipede/blob/main/doc/roadmap.md)
### Language
- Language surface reference: [doc/reference/surface.md](https://github.com/graydon/millipede/blob/main/doc/reference/surface.md)
- Language tutorial: [doc/guide/tutorial.md](https://github.com/graydon/millipede/blob/main/doc/guide/tutorial.md)
Note: the tutorial is messy, and the worked example quite trivial. The language is mostly meaningful in terms of its restrictions and missing features; there's nothing exciting about it from an expressivity perspective. I wouldn't bother reading it unless you're morbidly curious, it reads mostly like Lean do-notation with some Rust-isms thrown in. Humans aren't the target audience for writing Millipede programs anyways.
If you're just wondering what it looks like, here's a snippet from the library:
```
mp def ByteBuf.readFrom (b : &mut ByteBuf cap) (fd : UInt64)
requires ByteBuf.Inv cap b
ensures ByteBuf.Inv cap b' : UInt64
:=
do
let n := b.len
let r := ByteBuf.sysRead fd (&mut b.bytes[n..cap])
if r <= cap -! n then
b.len := n +! r
r
else r
```
There should really be nothing surprising in the language.
## Prior art
[Tons](https://github.com/graydon/millipede/blob/main/doc/design/prior-art.md). There's really nothing new here besides:
- LLM attackers increasing the urgency of adopting more rigorous techniques.
- LLM programmers reducing the cost of adopting those techniques, including proof-writing.
- LLM compiler-writers reducing the cost of proving the compilers themselves correct.
When costs change, it can change which techniques make sense.
## Cost and complexity
Writing this used 1 week of Fable 5.2 time driving mostly Opus 5.5 agents driving Lean on a macbook air M4 laptop.
As a quarter-month worth of a USD $200/mo "ultra" subscription -- 100% of weekly quota was used -- it feels fair to call it USD $50 of compute. Plus or minus whatever arithmetic you apply to Anthropic's subsidized subscription rates.
Human supervision / intervention time was about 6 hours total. Mostly I just checked in at the beginning and end of each day.
The codebase weighs in at roughly:
- 60kloc of Lean
- 2000-ish definitions
- 3000-ish theorems
- 13kloc of comments
- 15kloc of tests | motownphilly | 2 | 0 |
| 🟧 echo.github ⭐ | An experimental language implemented in Lean, designed for LLM-written programs with extensive typing disciplines and verified compilation; | Graydon Hoare | — | — |
Interpretation history
2026-11-23T15:20:31Z
audience grounding: high — Millipede is a concrete experiment in using LLMs not just to write software, but to help build a language that constrains what LLM-written software can do. If the approach proves sound and practical, it could lower the cost of applying formal methods and make stronger safety properties more accessible. For now, this is a research provocation rather than a usable tool: its author explicitly flags uncertainty about correctness and poor performance.
Decision trace
- 11-24 02:20groundMillipede is a concrete experiment in using LLMs not just to write software, but to help build a language that constrains what LLM-written software can do. If the approach proves sound and practical,
- 11-24 00:25attention_candidatecreate
- 11-24 00:23createThe repository is a concrete, unusually ambitious experiment in using LLMs to lower the cost of formal programming techniques, but its author explicitly presents it as unvalidated exploratory work.