ain_
A programming language built for code written by AI.
General-purpose by design, AI-authored by intent. Ain combines compact prefix syntax, inferred primitive types, and a functional-first foundation with an intentionally extensive standard library.
Less scaffolding. Still code.
No `fn` keyword, call parentheses, or explicit integer annotations in this example.
add a b = + a b
square x = * x x
result = add square 3 square 4
print resultLess code. Fewer tokens?
Source-code token counts from the latest published Ain benchmark snapshot, refreshed from GitHub approximately every hour.
5 matched programming tasks
| TASK | Ain | Python | TypeScript | Rust |
|---|---|---|---|---|
| Arithmetic | 16 | 20 | 24 | 31 |
| Factorial | 23 | 28 | 33 | 43 |
| Generics | 19 | 25 | 31 | 38 |
| Lists | 23 | 33 | 35 | 48 |
| Strings | 17 | 20 | 27 | 32 |
Designed for generated programs.
AI-first source
Fixed-arity prefix expressions and minimal punctuation aim to keep generated programs short and predictable.
Functional-first
Data transformations are the default, with explicit mutable state and controlled side effects when needed.
Batteries included
The experimental runtime is growing collections, JSON, filesystem, network, and other built-in operations.
Native compilation
The Rust stage-zero compiler works alongside a limited direct AIR-to-LLVM backend and a self-hosting experiment.
Run an example.
The Nix development shell is the recommended setup. Requires Rust and the native toolchain.
git clone https://github.com/honerop/ain.git
cd ain
nix develop
cargo test
cargo run -- run examples/arithmetic.ain