Bend 2 Released: A Proof-Oriented Language That Fails Compilation on AI Code Rule Violations
Key point
Bend 2, a proof-oriented language designed to fail compilation when AI-generated code violates human-specified rules (LAWS.bend), has been released.
Details
'Law-Driven Development' for Ensuring AI Code Reliability
Bend 2 is a new programming language that forces compilation to fail if code written by AI coding agents violates human-specified rules (LAWS.bend). Released in September 2026, it adopts the Apache 2.0 license. The core concept is the 'Law-Driven Development' paradigm, which ensures code correctness through compiler-verifiable formal proofs (PROOF.bend) rather than natural language prompts or tests.
Technical Features and Performance
- Language Structure: Combines Python syntax, Lean/Haskell semantics, and Rust resource management. It features an Affine type system by default, strictly controlling variable reuse to guarantee memory safety and termination.
- Performance: Aims for C-level speed and supports GPU execution. On an Apple M4 Max with 16 CPU cores, it achieved 7.6–12.1x speedup over a single core. While the GPU significantly outperforms the CPU in uniform computations, it can be slower than the CPU in cases with many branches or imbalanced workloads. Additionally, GPU performance varies greatly depending on the Apple chip tier (M4 Max vs. base M4).
- Proof Speed: With 12,800 definitions, the proof checking time is 0.29 seconds, much faster than Lean (36.2 seconds) or Rocq (5.99 seconds), making it suitable for AI agents' iterative code generation and verification loops.
Limitations and Caveats
- Early Ecosystem Stage: The ecosystem is very early, with no Windows support, missing TLS/HTTP/JSON/regex libraries, and no editor or debugger provided.
- Compiler Reliability: 99% of the compiler code was written by AI and has not yet been fully audited. There is a possibility of soundness bugs due to discrepancies between the formalized model and the actual implementation.
- Limitations of Rules: Logical errors in the laws themselves cannot be verified, so auxiliary laws must be used in parallel to prevent edge cases such as passing empty lists.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.