Bend is a high-level programming language designed to run in parallel across CPU cores and GPUs without threads, locks, or manual kernel code. It targets developers, especially those working with AI coding agents, who want a language precise enough to state intent unambiguously and a compiler that can mathematically verify that intent holds. The pitch centers on LAWS.bend, a file where you declare rules your app must never break, which the compiler checks via required proofs whenever code changes.
Bend compiles to C, Metal, CUDA, and JavaScript. Its type system is affine and dependent, which lets the compiler both generate fast native code and check formal proofs quickly. The project describes itself as young, with a compiler that is largely AI-written and not yet fully audited.
bend guide prints the language guide, bend base prints the base library, and bend PROOF.bend runs proof checks.Bend fits projects where an AI coding agent writes most of the implementation and you need a mechanical way to catch logic errors before they merge, such as game rule enforcement, invariant-heavy backend logic, or small proof-carrying utilities. It also suits experiments in parallel computation where you want a divide-and-conquer style program to spread automatically across CPU cores or a GPU without writing kernel code.
It's not a good fit for production systems needing mature tooling: there's no debugger, profiler, REPL, package versioning, or full editor support (only formatting, no completion or diagnostics). Text-heavy applications suffer too, since strings are linked lists of characters and processing is slow. Anything needing 64-bit numbers, TLS, JSON, regex, or HTTP out of the box will require writing foreign bindings yourself. Windows users need WSL, and the language currently supports one GPU per program with no multi-machine execution.
Install Bend with the provided install script:
curl -fsSL https://bend-lang.com/install.sh | sh
To have an AI agent use Bend correctly, add instructions to your AGENTS.md:
When using Bend:
- run `bend guide` to learn it
- use `LAWS.bend` to keep important rules
- run `bend PROOF.bend` before committing
- parallelize the code whenever possible
Then tell your agent "use Bend" and it can pick up the guide and conventions from there.
Bend works best on the back-end, on Linux or macOS. Compiling to native targets requires clang 14+ (19+ for GPU dispatch via !), and Metal or CUDA 12 for GPU targets. On Linux, windowing and audio effects need X11 and ALSA headers. For faster iteration during development, the JavaScript target is recommended over native compilation, which is slower due to clang/CUDA/Metal build times. Reference material includes GUIDE.md (also printed by bend guide), a demos/ folder with example apps and their LAWS.bend files, and the base.bend standard library.