cd /news/ai-agents/bend-2-is-here · home topics ai-agents article
[ARTICLE · art-133047] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Bend 2 Is Here

Bend 2 has launched with a new `LAWS.bend` file that forces AI coding agents to write mathematical correctness proofs, using Bend's compiler to guarantee declared rules always hold. The language's developers claim Bend compiles to executables as fast as hand-written C on a single CPU core and faster across thousands of cores, and that the compiler verifies mathematical proofs in under a second — work they say takes other projects minutes. The release positions `LAWS.bend` as "`AGENTS.md` backed by proof," blocking AI-generated bugs that would otherwise be merged.

read6 min views2 publishedSep 17, 2026
Bend 2 Is Here
Image: Michielbdejong (auto-discovered)

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.

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.

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.

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:

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.

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. 3. Ask your AI to run bend PROOF.bend after editing any code. 4. 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:

law you_cant_win:                           # "winning is impossible"
  for moves: List<Game.Move>                # any sequence of moves
  board = Game.replay(Game.start(), moves)  # replayed from the start
  {Game.is_won(board) == False{} : Bool}    # never leads to victory
def Laws.you_cant_win(moves):

In short, LAWS.bend is AGENTS.md backed by proof.

With LAWS.bend, "make no mistakes" becomes enforceable.

Skeptical? Edit the demo's code and break the "you can't win" law!

curl -fsSL https://bend-lang.com/install.sh | sh

Add this 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, just say: "use Bend"!

Hints:

Ask it to write laws for anything that can't break. #

Ask it to parallelize anything you want to be fast. #

Bend is young. If anything goes wrong, ask it to open an issue. <3

Bend works best on the back-end, on Linux or macOS.

import Base

def main() -> IO(Unit):
  do IO<Unit>:
    name : String <- IO.try(String, IO.get_env("USER"))
    IO.print("Hello, " ++ name)
python
import Base

def pow2(+d: Nat) -> U32:
  match d:
    case 0n:
      1
    case 1n+p:
      a b = pow2(p) pow2(p)
      (a + b : U32)

def main() -> IO(Unit):
  result = pow2!(20n)
  IO.print(U32.show(result))
python
import Base

law add_zero:
  for x: Nat
  {Nat.add(x, 0n) == x : Nat}

def add_zero(x):
  match x:
    case 0n:
      {==}
    case 1n+xp:
      %add_zero(xp) : {1n+Nat.add(xp, 0n) == 1n+_ : Nat}
      {==}
- Bend 2 is a new language. Bend 1 programs and HVM do not carry over.
- Everything is annotated and nothing is inferred, so code is verbose.
- No type classes, no traits, and no macros beyond compile-time templates.
- Bend has no tactics or proof search; proving theorems takes extra effort.
- Values are affine: closures and arrays cannot be shared.
- Recursion must be terminating. (Use `@unsafe` to disable this checker.)
- Computed matches (`match f(x)`) aren't supported. Must split it manually.
- There is no syntax for if-then-else: a branch is a match on True and False.
- Numbers are Nat, U32 and F32 only: no U64, I64 or F64 (Metal has no f64).
- F32 is axiomatic: nothing about floating point can be proven.
- Strings are linked lists of characters, so text processing is slow.
- Base is small: expect to write helpers other languages ship built in.
- Effects are few: print, env, time, sleep, spawn, channels, files, TCP, UDP.
- No TLS, HTTP library, JSON or regex for now (but you can add them as foreigns).
- Targets are C, Metal, CUDA and JavaScript; Lua, Luau and Python are planned.
- The JavaScript target runs on one core and has no graphics or audio.
- Parallelism requires balanced calls. Flexible parallelism will be added later.
- Sharing arrays with atomics across threads is experimental and needs `@unsafe`.
- One GPU per program, one event loop, and no multi-machine execution yet.
- One C file per program: no separate compilation, no incremental builds.
- Compiling to native is slow (clang/CUDA/Metal). For fast development, use JS.
- The compiler is young and has blind spots (unusually slow programs). Report.
- We don't have as many benchmarks as we'd like yet, especially for the checker.
- The compiler (not kernel) is 99% AI-written and has not been fully audited yet.
- The Lean formalization and bend.ts mismatch. Early consistency bugs may occur.
- A binary needs clang 14+; ! needs 19+, Metal or CUDA 12.
- No Windows (WSL works); on Linux, Window and Audio need X11 and ALSA headers.
- The hub has no names, versions, accounts or search yet. Packages are hashes.
- Error messages are terse; no debugger, profiler, formatter, REPL or LSP.
- No editor support, no test framework and no documentation beyond the guide.
- And more that escape me. Be patient, report bugs and request features!

Most of these limitations are being addressed and will improve over time!

BEND IS YOUNG. EXPECT BUGS AND REPORT THEM.

── more in #ai-agents 4 stories · sorted by recency
── more on @bend 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/bend-2-is-here] indexed:0 read:6min 2026-09-17 ·