Back to projectsExperimental programming language

ain.

Software for machine authors

Less code.
More capability.

A general-purpose language designed for code written by AI, not optimized for human typing.
Prefix syntaxInferred typesBroad standard libraryRust + experimental LLVM
Language

Only what matters.

example.ainsource
add a b = + a b
square x = * x x

print add square 3 square 4
Output25

Fewer symbols. No call parentheses. No mandatory function keyword.

The compiler handles the structure; the model focuses on expressing the operation. That is the experiment, not a claim that Ain already outperforms other languages.

Read language reference
Design

Deliberately excessive.

01

Small expressions

Fixed-arity prefix syntax and inferred types reduce the scaffolding a model has to generate.

02

An enormous vocabulary

An extensive built-in library aims to express complex operations in very little source code.

03

Real compilation

Rust-backed native compilation today, with a limited experimental AIR and LLVM path.

Token benchmark

Less code. Fewer tokens?

Source-code token counts from the latest published Ain benchmark snapshot, refreshed from GitHub approximately every hour.

Published results

5 matched programming tasks

Tokenizer: o200k_base
Ain
98baseline
Python
126Ain −22.2%
TypeScript
150Ain −34.7%
Rust
192Ain −49.0%
Source tokens for the same tasks in four languages
TASKAinPythonTypeScriptRust
Arithmetic16202431
Factorial23283343
Generics19253138
Lists23333548
Strings17202732

Lower is better. Small hand-written examples, counted with the same tokenizer. Not LLM prompt, reasoning, retry, or total generation tokens.

Research, not a finished language.

Ain is pre-alpha. The Rust backend supports more builtins than the experimental LLVM backend. Performance and token claims should be judged using real, repeatable benchmarks.

Documentation