Bend Language: Prove Code Correct, Run Fast on GPU
AI News

Bend Language: Prove Code Correct, Run Fast on GPU

4 min
9/18/2026
BendProgramming LanguageAI SafetyFormal Verification

Bend: A New Language That Makes AI Coding Mistakes Mathematically Impossible

In the rush to adopt AI-assisted development, a critical problem has emerged: how do you trust code you never read? Bend, a new open-source programming language from Higher Order Company, offers a provocative answer: demand a mathematical proof that the code is correct before it can be merged.

Bend combines three rarely-coexisting properties: near-C execution speed, automatic parallelism across CPU cores and GPUs, and a dependent type system strong enough to verify program behavior. The result is a language designed for the post-AGI era, where humans specify intent through precise 'laws' and AI agents generate code that must prove compliance.

Proof-Checking as a Bug Barrier

At the heart of Bend is a novel workflow. Developers write laws in a LAWS.bend file, declaring invariants that must never be broken. When an AI agent generates code, it must also produce a proof in PROOF.bend that the implementation satisfies those laws. Bend's type checker then verifies the proof, acting as a mathematical gatekeeper.

"'Make no mistakes' is now type-checked," the project's website explains. The system is built on an affine dependent type theory called BendTT, with a parallel runtime (BendRT) that executes the verified code.

Real-World Demonstration: A Game That Can't Be Cheated

The project demonstrates the concept with a simple game. A law declares that winning is impossible—no sequence of moves can lead to victory. When a test feature request asks the AI to "make the board wrap around," the system either rejects the change if it violates the law or forces the AI to retry until it can prove the new behavior still upholds the invariant.

Without Bend, such a bug would merge silently. With Bend, merging a violation is mathematically impossible—it's a theorem, not just a test.

Performance: C Speed, GPU Parallelism

Bend isn't just about correctness. It compiles to native code that runs nearly as fast as C on a single core, while the same binary can scale to sixteen cores or thousands of GPU cores automatically. Benchmarks on an Apple M4 Max show Bend outperforming C on parallel workloads, with the company claiming up to 100x speedup over single-core execution on GPUs.

The magic lies in interaction nets, a computational model that splits work into binary recursive calls that can be spread across hardware without explicit threading, locks, or kernel code. The runtime handles allocation, garbage collection, and scheduling automatically.

continue reading below...

Fast Compilation for AI Iteration

Traditional proof checkers like Lean or Rocq can take minutes on mid-sized codebases—too slow for AI agents that need to iterate rapidly. Bend's type checker completes in under a second, making it practical for AI to verify every change. This speed is crucial for integrating proof-checking into the development loop.

Bend2 and the Evolution of the Runtime

The project has evolved rapidly. Bend2 targets HVM4, the fourth generation of a runtime line that began in 2022. A notable milestone came in July 2026, when a coding model (Anthropic's Fable) implemented the CUDA runtime overnight from a reference Metal version, reportedly running faster than Metal on RTX hardware—roughly 10x parallel C for most programs.

This porting success underscores a key thesis: well-specified engineering tasks can be automated, but the design and verification layers remain human.

How to Get Started

Installation is straightforward:

curl -fsSL https://bend-lang.com/install.sh | sh

Add bend guide, LAWS.bend, and bend PROOF.bend to your AGENTS.md file, then instruct your AI to "use Bend." The language works best on Linux and macOS for back-end development.

Why It Matters

Bend represents a significant bet on the future of software development. As AI agents write more code, the ability to formally verify that their output meets specifications becomes critical. By making correctness provable and parallelism automatic, Bend offers a compelling vision: code that is both fast and trustworthy, even when no human has read it.

The project is still young and evolving, with the author acknowledging it's a work in progress. But the combination of proof-checking, automatic parallelism, and AI-friendly design positions Bend as a language to watch for teams embracing AI-assisted development.