bend
Skill7 starsChanged 53 days agoApache-2.0View on GitHub
Bend is a programming language that combines Lean-like formal proofs with C-like speeds and CUDA-like parallelism. It gives humans an ambiguity-free language to communicate intents to AIs, a compiler capable of mechanically checking mathematical correctness, and a runtime that executes code fast on CPUs and GPUs.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- realnedsanders/bend-skilltheir own version, first seen Oct 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- realnedsanders/bend-skill★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- bend-formalizerSkill
- dodSkill
- dopSkill
- hpcSkill
- okfSkill
- pr-reviewerSkill
- quality-testingSkill
- security-auditSkill
- simulate-user-testingSkill
- theorem-oriented-programmingSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Run bend guide to learn the core syntax and concepts.
- Very specific: line 11
Use LAWS.bend to declare business rules, invariants, and specifications.
- Very specific: line 12
Use PROOF.bend to formally prove every law declared in LAWS.bend.
- Very specific: line 13
Run bend check <file>.bend and bend PROOF.bend before committing.
- Distinctive: line 17
Write laws for whatever should never break, and parallelize everything you want running fast.
- Distinctive: line 19
All files and documentation in this skill are maintained strictly in English.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bend Skill Guide
When using Bend:
- Run
bend guideto learn the core syntax and concepts. - Use
LAWS.bendto declare business rules, invariants, and specifications. - Use
PROOF.bendto formally prove every law declared inLAWS.bend. - Run
bend check <file>.bendandbend PROOF.bendbefore committing. - Parallelize operations whenever compute-intensive or recursive tree reductions are involved.
Rules
- Write laws for whatever should never break, and parallelize everything you want running fast.
- The Common Errors reference must be updated whenever new error patterns are identified.
- All files and documentation in this skill are maintained strictly in English.
Hello, World!
Bend's syntax is Python-shaped, with pure functional semantics closer to Haskell / Lean, while remaining resource-aware like Rust. A hello world is a typed definition returning an IO block:
import Base
def main() -> IO(Unit):
do IO<Unit>:
IO.print("Hello, world!")To run it:
bend hello.bendBend is a pure language where side-effects are encapsulated inside the IO Monad.
Reference Summary & Examples
Core Language & Topics
- Tooling: CLI commands (
bend,bend check,bend -c), compilation flags, and workflows. - Syntax Reference: Complete grammar reference, literal formats, AST forms, and assignment rules.
- Types and Functions: Data types, constructors, function signatures, and affine annotations (
+). - Closures: Anonymous functions, lambda expressions, and environment capture.
- Recursion and Termination: Structural recursion, totality checks, and
@unsafeescape hatch. - Parallelism: Multi-threaded execution, parallel dispatch (
a b = f(x) g(y)), and GPU execution (f!(x)). - Arrays: Single-owner mutable arrays with $O(1)$ in-place updates (
a[i] <- v). - Quantities: Variable usage tracking with
&0(erased),&1(affine), and&2(unrestricted data). - Kinds: Type classification into
Data(copiable) andType(linear/non-copiable). - Templates: Compile-time monomorphization and metaprogramming via
~arguments. - Laws and Proofs: Formal verification workflow using
LAWS.bendandPROOF.bend. - IO and Concurrency: Encapsulating effects, file operations, sockets, and asynchronous tasks.
- Monads: Monadic computation chains,
doblocks,Maybe, andResult. - Apps: Interactive 2D/3D graphical applications and game engines in pure Bend.
- The Base Library: Standard prelude types (
Bool,Nat,U32,F32,List) and core operations. - Modules: Multi-file organization, relative imports, aliasing, and diamond deduplication.
- Common Errors: Comprehensive catalog of common compiler errors, anti-patterns, and idiomatic fixes.
Test Subskills (Located in .agents/skills/bend/tests/)
- Base Tests: Standard library primitives, algebraic types, and built-in type operations.
- Check Tests: Type checking, kind inference, and affine linearity verification.
- Compile Tests: Compiler pipeline, lowering targets, and native C/CUDA code generation.
- Comptime Tests: Compile-time evaluation, constant folding, and template macro expansion.
- Cost Tests: Work metrics, interaction net rewrite accounting, and complexity analysis.
- Eval Tests: Term reduction, normal-form computation, and operational evaluation.
- Flatten Tests: Pattern matching compilation and decision tree flattening.
- Gfx Tests: 2D/3D graphics rendering, pixel shaders, and display loops.
- Grade Tests: Resource grading, quantities (
&0,&1,&2), and erased proof parameters. - Halt Tests: Termination checking, structural recursion, and infinite loop prevention.
- Import Tests: Module resolution, relative paths, and cross-file proof linking.
- IO Tests: Side-effect encapsulation, concurrent TCP sockets, and file streams.
- Page Tests: Memory paging and single-owner mutable array operations.
- Parse Tests: Lexical analysis, syntax grammar rules, and operator precedence.
- Printer Tests: Pretty-printing, AST desugaring, and term formatting.
- Proof Tests: Theorem proving, propositional equality, reflexivity (
{==}), and rewrites. - Reg Tests: Backend register allocation and affine variable lifecycles.
- RFC Tests: Bend language specifications, modern idioms, and RFC evolutions.
- Run Tests: End-to-end execution on CPU and CUDA GPU backends.
- Show Tests: Interactive term inspection, hole diagnostics (
?name), and goal debugging. - Spec Tests: Formal operational semantics and core language invariants.
- State Tests: Pure state threading, state monads, and mutable cell abstractions.
- Stats Tests: Runtime profiling, node allocation metrics, and throughput counters.
- Stuck Tests: Stuck term diagnostics, reduction failures, and deadlock resolution.
Further Reading
demos/: Complete example programs (HTTP server, ray tracer, parallel sorting, 3D boss fight game).bend2/base.bend: The official Base prelude library (or runbend base).paper/BendTT.pdf&paper/BendRT.pdf: Formal type theory and runtime specifications.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

