agentleFS
k3ybladewielderk3ybladewielder/skills/bend/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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.

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
  1. Very specific:

    Run bend guide to learn the core syntax and concepts.

    line 10
  2. Very specific:

    Use LAWS.bend to declare business rules, invariants, and specifications.

    line 11
  3. Very specific:

    Use PROOF.bend to formally prove every law declared in LAWS.bend.

    line 12
  4. Very specific:

    Run bend check <file>.bend and bend PROOF.bend before committing.

    line 13
  5. Distinctive:

    Write laws for whatever should never break, and parallelize everything you want running fast.

    line 17
  6. Distinctive:

    All files and documentation in this skill are maintained strictly in English.

    line 19

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bend Skill Guide

When using Bend:

  • Run bend guide to learn the core syntax and concepts.
  • Use LAWS.bend to declare business rules, invariants, and specifications.
  • Use PROOF.bend to formally prove every law declared in LAWS.bend.
  • Run bend check <file>.bend and bend PROOF.bend before 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.bend

Bend 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 @unsafe escape 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) and Type (linear/non-copiable).
  • Templates: Compile-time monomorphization and metaprogramming via ~ arguments.
  • Laws and Proofs: Formal verification workflow using LAWS.bend and PROOF.bend.
  • IO and Concurrency: Encapsulating effects, file operations, sockets, and asynchronous tasks.
  • Monads: Monadic computation chains, do blocks, Maybe, and Result.
  • 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 run bend base).
  • paper/BendTT.pdf & paper/BendRT.pdf: Formal type theory and runtime specifications.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.