📈 GH Trending Explorer 🎲 Surprise me

← all repos

bendlang / bend

git clone https://github.com/bendlang/bend.git v2.0.38 · 1d ago

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

+8
stars, 24h · #1,844
+~56
stars, 7 days · #2,283
+~240
stars, 30 days · #2,248
24k
★ total · +0% this week
760
forks · 108 open issues

Star history (as recorded here)

2026-10-20 · 23,838 ★ 2026-10-22 · 23,865 ★
LanguageTypeScript
LicenseApache-2.0
Created2023-08-29 (3y ago)
Last pushtoday
Watchers117
OwnerOrganization

GitHub topics

Links

README excerpt
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 impossible So 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:
 [code] 
 [co