Bend is a programming language built on the premise that as AI agents increasingly generate software, humans need a way to verify that the resulting code correctly implements their intentions. The language introduces a mechanism where developers declare 'laws'—precise, unambiguous rules that the application must never violate. For example, a developer might declare a law stating that a specific game state is impossible to reach. When an AI agent attempts to modify the code, the Bend compiler acts as a gatekeeper: it will block any merge that violates these laws unless the AI can also provide a mathematical proof that the new code satisfies them.

A player character in a game environment walking toward a wall.
A demonstration of a game state where a player interacts with a boundary defined by a 'law'.github.com

This visual illustrates the concept of declaring 'laws' to prevent impossible game states.

A player character wrapping around a game edge to reach a flag.
A scenario showing a bug where a player bypasses a boundary, illustrating a violation of intended logic.github.com

This image demonstrates the type of bug that the Bend compiler's 'laws' are designed to prevent.

A wall on the far edge of a game level stopping a player character.
The corrected game state where a 'law' successfully prevents the player from wrapping around the edge.github.com

This visual shows the successful enforcement of a mathematical law to maintain game integrity.

The technical core of Bend is its compiler, which functions as a high-speed proof checker. While traditional proof assistants like Lean or Rocq can take minutes to verify a mid-sized codebase, Bend is designed to perform these checks in under a second. This speed allows AI agents to verify correctness after every incremental change. Furthermore, Bend is designed for high performance, compiling to native code that runs nearly as fast as C on a single CPU core. It also supports massive parallelism, allowing code to run on thousands of GPU cores without the need for manual thread management or kernel writing, as the language handles the distribution of work automatically.

A benchmark chart comparing Bend's checker performance against Isabelle, Agda, Lean, and Rocq.
Benchmark results showing Bend's high-speed proof checking compared to traditional proof assistants.github.com

This chart supports the claim that Bend performs checks in under a second, much faster than traditional tools.

A runtime benchmark graph comparing Bend's performance to C, TypeScript, and Lean across multiple cores and GPUs.
Runtime performance benchmarks demonstrating Bend's native speed and GPU parallelism.github.com

This graph illustrates Bend's ability to run nearly as fast as C and its support for massive GPU parallelism.

An animation showing power-of-two splitting over 4,096 GPU cores and folding back.
A visualization of Bend's automatic distribution of work across thousands of GPU cores.github.com

This animation demonstrates the language's ability to handle massive parallelism without manual thread management.

Despite its promise of 'bug-free' code, using Bend involves specific trade-offs and practical hurdles. Because the language requires formal proofs, even basic arithmetic operations may require the developer or the AI to define foundational properties. For instance, a user reported that an AI agent struggled with certain arithmetic laws because the base library lacked a full order theory, requiring the AI to write structurally recursive proofs for basic functions like maximum values. Additionally, while Bend provides a robust framework for verifying intent, the complexity of defining these 'laws' for highly intricate systems remains a significant consideration for developers moving away from natural language specifications. The project is currently in an early stage, and its lack of a public commit history has been noted as a point of consideration for those evaluating its long-term development and reliability.