Bend
An open-source, fast programming language that blocks AI coding mistakes via mathematical proof, with Python-like syntax and automatic CPU/GPU parallelism.
At a Glance
About Bend
Bend is an open-source programming language created by Victor Taelin and the team at HigherOrderCO, designed for the post-AGI era where AI agents write most code. It combines Python-like syntax with dependent types, automatic parallelism, and a built-in proof system that mathematically enforces correctness rules. The project is licensed under Apache 2.0 and is actively developed on GitHub, where it has accumulated over 23,000 stars as of late 2026.
What It Is
Bend is a compiled, statically-typed programming language that targets CPU, GPU (CUDA and Metal), and JavaScript runtimes. Its core thesis is that as AI agents write more code, humans need a way to specify correctness constraints that the compiler can mechanically enforce — not just as tests, but as mathematical proofs. The language draws inspiration from Lean and Rocq for its proof system, from functional languages for its purity and linearity, and from Python for its surface syntax.
How the Proof System Works
The central innovation in Bend is the LAWS.bend file, which the project describes as "AGENTS.md backed by proof." Developers (or AI agents) declare invariants — called laws — that the application must never violate. The compiler then requires a corresponding proof in PROOF.bend before any code change can be committed. The project's own documentation illustrates this with a game demo: a law stating "winning is impossible" is declared once, and any AI-generated feature that would break that law is rejected at compile time, making it "mathematically impossible to break laws in LAWS.bend."
Example law types the README lists:
- "The sum of all balances must be zero"
- "Players can never pass through solid walls"
- "list_sort() must always return ascending numbers"
- "array_set() may never be called out-of-bounds"
Performance Architecture
Bend's runtime targets near-C speed on a single CPU core and CUDA-level throughput on the GPU. The homepage benchmarks show a Game of Life implementation running at 7.80s on one core, 0.65s on 16 cores, and 0.06s on the GPU — a claimed 124× speedup over single-core on an Apple M4 Max. Parallelism is expressed via divide-and-conquer patterns: splitting work in two causes Bend to automatically spread calls across available cores, then join results. No threads, locks, or GPU kernels need to be written explicitly.
The type checker doubles as a proof checker. The homepage benchmarks compare proof-checking speed against Isabelle, Agda, Lean, and Rocq, with Bend completing 3,200 generic instantiations in 0.38 seconds versus over 5 minutes for Isabelle and Agda, and 19.2 seconds for Lean.
Vibe-Coding Workflow Integration
Bend is explicitly designed to work with AI coding agents. The recommended setup involves adding a snippet to AGENTS.md that instructs the agent to run bend guide to learn the language, use LAWS.bend for important rules, and run bend PROOF.bend before committing. The project positions itself as infrastructure for "vibe-coded apps" — AI-generated applications where the human specifies intent through laws rather than by reading every line of code.
Compilation targets include C, Metal, CUDA, and JavaScript. Linux and macOS are the primary supported platforms; Windows is not supported natively (WSL works). The JavaScript target runs on one core and has no graphics or audio support.
Update: Bend 2.0.34
The latest release is v2.0.34, published on September 29, 2026. The project notes that Bend 2 is a complete rewrite — Bend 1 programs and the HVM runtime do not carry over. The README explicitly lists current limitations: no type classes or traits, no tactics or proof search, no TLS or HTTP library, no JSON or regex built-in, no Windows native support, no incremental builds, and terse error messages with no debugger or REPL. The team acknowledges the compiler is "99% AI-written and not yet fully audited" and encourages users to report bugs. Most listed limitations are described as actively being addressed.
Community Discussions
Be the first to start a conversation about Bend
Share your experience with Bend, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free and open-source under Apache License 2.0. Install via curl and use without restriction.
- Full language compiler (CPU, GPU, JS targets)
- LAWS.bend proof enforcement
- Automatic parallelism on CPU and GPU
- bend guide CLI reference
- Community Discord and GitHub Issues support
Capabilities
Key Features
- Mathematical proof enforcement via LAWS.bend
- Automatic CPU and GPU parallelism via divide-and-conquer
- Python-like syntax with dependent types
- Fast proof checker (sub-second for files that take minutes in Lean/Rocq)
- Compiles to C, Metal, CUDA, and JavaScript
- AI agent workflow integration via AGENTS.md
- Affine dependent type theory (BendTT)
- Parallel runtime for CPUs and GPUs (BendRT)
- bend guide CLI command for in-terminal language reference
- PROOF.bend correctness verification before commit
