[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"readme:bend":3},"\u003Cp align=\"center\">\u003Cpicture>\u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"media\u002Fhero_dark.gif\">\u003C\u002Fsource>\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fbendlang\u002Fbend\u002FHEAD\u002Fmedia\u002Fhero.gif\" width=\"560\" alt=\"Bend: a fast language that blocks AI mistakes via proof\" \u002F>\u003C\u002Fpicture>\u003C\u002Fp>\u003Cp>In the post-AGI economy, humans will eventually stop writing and reading code,\nbut we still need an ambiguity-free language to communicate our intents to the\nAIs building the world around us. Bend is that language.\u003C\u002Fp>\n\u003Cp>With \u003Cstrong>laws\u003C\u002Fstrong>, intents can be more precise than natural language. With\n\u003Cstrong>proofs\u003C\u002Fstrong>, we can mechanically verify the AI implemented our prompts correctly.\nAnd with a \u003Cstrong>fast compiler\u003C\u002Fstrong>, we can run that code at peak compute.\u003C\u002Fp>\n\u003Cp>That's Bend - and nothing else.\u003C\u002Fp>\n\u003Ch2>Bend runs FAST\u003C\u002Fh2>\n\u003Cp>\u003Cstrong>Target:\u003C\u002Fstrong> be as fast as C on the CPU, as fast as CUDA on the GPU. \u003Cstrong>Status:\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fbendlang\u002Fbend\u002FHEAD\u002Fmedia\u002Fruntime.gif\" width=\"640\" alt=\"Runtime benchmarks: Bend vs C, TypeScript, Lean, on 1 core, 16 cores and the GPU\" \u002F>\u003C\u002Fp>\u003Cp>Thanks to strong types, purity and linearity, Bend compiles to fast executables\nas fast as hand-written C (single-core), and even faster (on 10000s cores). The\nentire language runs on the GPU, with full memory unification.\u003C\u002Fp>\n\u003Ch2>Bend checks FAST\u003C\u002Fh2>\n\u003Cp>\u003Cstrong>Target:\u003C\u002Fstrong> outperform every proof assistant by several OOMs. \u003Cstrong>Status:\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fbendlang\u002Fbend\u002FHEAD\u002Fmedia\u002Fchecker.gif\" width=\"640\" alt=\"Checker benchmarks: Bend vs Isabelle, Agda, Lean, Rocq\" \u002F>\u003C\u002Fp>\u003Cp>Bend's compiler is so powerful it can verify mathematical proofs. Usually, this\nis slow. Bend is not. It checks, in under a second, files that other projects\nwould take minutes, making proofs way more practical.\u003C\u002Fp>\n\u003Ch2>Bend is PARALLEL\u003C\u002Fh2>\n\u003Cp>No threads, no locks, no kernels to write. Split the work in two, and Bend\nspreads the calls over every core it can find, then joins them back. Below,\n\u003Ccode>pow2(20)\u003C\u002Fcode> divides until one task sits on each of 4,096 GPU cores:\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fbendlang\u002Fbend\u002FHEAD\u002Fmedia\u002Fparallel.gif\" width=\"440\" alt=\"pow2 splitting over 4,096 GPU cores, then folding back\" \u002F>\u003C\u002Fp>\u003Ch2>Bend BLOCKS mistakes - with proof\u003C\u002Fh2>\n\u003Cp>PROBLEM: How can you \u003Cstrong>trust\u003C\u002Fstrong> AI code, without reading it?\u003C\u002Fp>\n\u003Cp>SOLUTION: By forcing your AI to write a \u003Cstrong>correctness proof\u003C\u002Fstrong>.\u003C\u002Fp>\n\u003Cp>Bend introduces \u003Ccode>LAWS.bend\u003C\u002Fcode>, a file where you declare rules that your app must\nnot break. Bend's compiler then \u003Cstrong>guarantees\u003C\u002Fstrong> that these laws always hold, by\ndemanding \u003Cstrong>mathematical proof\u003C\u002Fstrong> whenever your code is edited. For example,\nconsider a game with one law: \u003Cem>winning is impossible\u003C\u002Fem>. Here's how it plays out:\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Cb>Law\u003C\u002Fb>: winning is \u003Cb>impossible\u003C\u002Fb>\u003Cbr \u002F>\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fbendlang\u002Fbend\u002FHEAD\u002Fmedia\u002Fgame_law.gif\" width=\"480\" alt=\"The player walks up and bumps the wall of the flag's room\" \u002F>\u003Cbr \u002F>\u003Ci>So far, it works!\u003C\u002Fi>\u003C\u002Fp>\u003Cp align=\"center\">\u003Cb>New feature:\u003C\u002Fb> \"Claude, make the board wrap around\"\u003C\u002Fp>\u003Cp align=\"center\">\u003Cb>Without LAWS.bend:\u003C\u002Fb>\u003Cbr \u002F>\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fbendlang\u002Fbend\u002FHEAD\u002Fmedia\u002Fgame_bug.gif\" width=\"480\" alt=\"The player wraps around the edge and takes the flag\" \u002F>\u003Cbr \u002F>\u003Ci>Laws broken. AI mistake: \u003Cb>merged\u003C\u002Fb>.\u003C\u002Fi>\u003C\u002Fp>\u003Cp align=\"center\">\u003Cb>With LAWS.bend:\u003C\u002Fb>\u003Cbr \u002F>\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fbendlang\u002Fbend\u002FHEAD\u002Fmedia\u002Fgame_law_kept.gif\" width=\"480\" alt=\"A wall on the far edge stops the player\" \u002F>\u003Cbr \u002F>\u003Ci>Laws intact. AI mistake: \u003Cb>blocked\u003C\u002Fb>!\u003C\u002Fi>\u003C\u002Fp>\u003Cp>Without \u003Ccode>LAWS.bend\u003C\u002Fcode>, a bug was merged. With it, the AI had to retry, until no\nbugs were left! In this case, it added a wall, but it could have moved the flag,\nmade the room kill you, or whatever. The only thing it can't do is commit a bug,\nbecause it is \u003Cstrong>mathematically impossible\u003C\u002Fstrong> to break laws in \u003Ccode>LAWS.bend\u003C\u002Fcode>. The\ncompiler \u003Cem>enforces\u003C\u002Fem> it.\u003C\u002Fp>\n\u003Cp>Using \u003Ccode>LAWS.bend\u003C\u002Fcode> is simple.\u003C\u002Fp>\n\u003Col>\n\u003Cli>\u003Cp>Ask your AI to formalize your app's rules in \u003Ccode>LAWS.bend\u003C\u002Fcode>. Example:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cp>LAW: \u003Cem>\"the sum of all balances must be zero\"\u003C\u002Fem>\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>LAW: \u003Cem>\"players can never pass through solid walls\"\u003C\u002Fem>\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>LAW: \u003Cem>\"list_sort() must always return ascending numbers\"\u003C\u002Fem>\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>LAW: \u003Cem>\"array_set() may never be called out-of-bounds\"\u003C\u002Fem>\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>LAW: \u003Cem>\"winning is impossible\"\u003C\u002Fem> (the demo above!)\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>And so on. Anything you can spell can become a law.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003C\u002Ful>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>Ask your AI to run \u003Ccode>bend PROOF.bend\u003C\u002Fcode> after editing any code.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>That's it. R\u003C\u002Fp>\n\u003C\u002Fli>\n\u003C\u002Fol>\n",1790633825888]