The Rank programming language / pre-alpha
Small screens. Big algorithms.
An array-oriented programming language designed for vertical screens and phone keyboards.
Ctrl-R steps. Ctrl-L runs all. Ctrl-G selects an iteration.
Compact enough for your pocket. Powerful enough for programming contests, data analysis, and neural networks.
Unlock the GPU and NPU already in your device to hack anywhere.
Open the console → Read the wiki →
Try on your computer.
npx @arrrank/cli
Requires Node.js 22.12+, Python and a C++20 build toolchain.
Closed beta
The language
Rank is a modern BASIC with an array-oriented model. Source is designed to stay around 40 characters per line, using words and familiar keyboard symbols rather than punctuation-heavy syntax.
Data flows through functions from left to right. A range can feed directly into a sum:
rank> use numbers
rank> 1 to 5 sum
15
Work with whole arrays and tensors, or select rows from a table. Arithmetic applies to each element without writing a loop:
rank> A = array 1 2 31 2 3rank> A * 10 + 111 21 31
A notebook-style CLI with editable cells, inline results and step-by-step execution, available in your terminal, browser and on your phone.
Advanced capabilities
Tensor operations include broadcasting, reductions along axis, operations on cells with rank, matrix multiplication and linear-system solvers.
M = (1 to 9) (array 3 3) reshape
Blocks = M (array 2 2) window
Blocks sum rank 2
12 16 24 28
shape 2 2
Built-in primitives for programming contests include sliding windows, Fenwick trees, segment trees and priority queues. Lazy ranges and generators let you process sequences without first storing every element.
Compile to Rust
Lazy sequences and array operations can be fused into efficient loops without intermediate arrays.
AI-assisted compilation turns Rank programs into standalone Rust. Generated agent prompts carry the source, AST, type and loop analysis, tests and optimization guidance. The resulting Rust is checked against the original Rank program on the same test inputs.
Notable examples
- Simple Conv2D — Deep-ML 41
Two-dimensional convolution with stride and padding in a three-line function body. - Subarray Sum Queries — CSES 1190
Maximum subarray sums after point updates, using a built-in segment tree. - Self Attention — Deep-ML 53
Scaled dot-product attention with matrix operations and numerically stable softmax. - Largest Palindrome Product — Project Euler 4
Find the largest palindromic product using an outer product and a boolean mask.