bendlang /bend

Bend 2: a fast language that blocks AI mistakes via proof. Install: curl -fsSL https://bend-lang.com/install.sh | sh

★ 25,987⑂ 828👁 108⑃ 1,431● 918▤ 33
TypeScriptApache-2.0Created 2023-08-29bend-lang.com
下载:Bend 2.0.40Bend-2.0.40 ↓2.0.402026-11-06
+29
日增长
+278
周增长
25,987
stars
828
forks
108
watchers
1,431
prs
918
issues
33
releases

README

In the post-AGI economy, humans will eventually stop writing and reading code,
but we still need an ambiguity-free language to communicate our intents to the
AIs building the world around us. Bend is that language.

With laws, intents can be more precise than natural language. With
proofs, we can mechanically verify the AI implemented our prompts correctly.
And with a fast compiler, we can run that code at peak compute.

That's Bend - and nothing else.

 Bend runs FAST

Target: be as fast as C on the CPU, as fast as CUDA on the GPU. Status:



Thanks to strong types, purity and linearity, Bend compiles to fast executables
as fast as hand-written C (single-core), and even faster (on 10000s cores). The
entire language runs on the GPU, with full memory unification.

 Bend checks FAST

Target: outperform every proof assistant by several OOMs. Status:



Bend's compiler is so powerful it can verify mathematical proofs. Usually, this
is slow. Bend is not. It checks, in under a second, files that other projects
would take minutes, making proofs way more practical.

 Bend is PARALLEL

No threads, no locks, no kernels to write. Split the work in two, and Bend
spreads the calls over every core it can find, then joins them back. Below,
pow2(20) divides until one task sits on each of 4,096 GPU cores:



 Bend BLOCKS mistakes - with proof

PROBLEM: How can you trust AI code, without reading it?

SOLUTION: By forcing your AI to write a correctness proof.

Bend introduces LAWS.bend, a file where you declare rules that your app must
not break. Bend's compiler then guarantees that these laws always hold, by
demanding mathematical proof whenever your code is edited. For example,
consider a game with one law: winning is impossible. Here's how it plays out:

Law: winning is impossibleSo far, it works!

New feature: "Claude, make the board wrap around"

Without LAWS.bend:Laws broken. AI mistake: merged.

With LAWS.bend:Laws intact. AI mistake: blocked!

Without LAWS.bend, a bug was merged. With it, the AI had to retry, until no
bugs were left! In this case, it added a wall, but it could have moved the flag,
made the room kill you, or whatever. The only thing it can't do is commit a bug,
because it is mathematically impossible to break laws in LAWS.bend. The
compiler enforces it.

Using LAWS.bend is simple.

1. Ask your AI to formalize your app's rules in LAWS.bend. Example:

    - LAW: "the sum of all balances must be zero"

    - LAW: "players can never pass through solid walls"

    - LAW: "list_sort() must always return ascending numbers"

    - LAW: "array_set() may never be called out-of-bounds"

    - LAW: "winning is impossible" (the demo above!)

    - And so on. Anything you can spell can become a law.

2. Ask your AI to run bend PROOF.bend after editing any code.

3. That's it. Rejoice as your app never again breaks or violates your rules.

You can also edit LAWS.bend yourself. Here's how it looks:

python
 LAWS.bend
law you_cant_win:                       

Top issues

Latest release

Bend 2.0.40 v2.0.40 2026-11-06
- The checker no longer hangs on a proof that a list is its own head <
  tail: conversion gave a share cell the value of an equal one, so a bare
  {==} of {Hd(D) < Tl(D) == D} made D name itself, and the next
  check through D never ended, or --verdict overflowed the stack. Equal
  cells now join a class and no value moves: a file that ran past 900 s
  checks in 3.3 s.
- bend --publish sends the README.md beside the entry, and the hub
  shows it (PR 2033).
- bend-cache (tools/): a proof cache for --check-only outside
  bend (PR 2045).
- Base: Array.get_unchecked, an @unsafe read without the wr

Snapshot: 2026-11-27T22:26:53Z · Data license Apache-2.0 · JSON