Rank is a modern BASIC for small screens and big algorithms.
- Data-first pipelines: values flow through functions from left to right.
- Multidimensional arrays, broadcasting, and operations by rank or axis.
- Lazy sequences, ranges, and generators.
- Functions, closures, and memoization.
- A notebook-style CLI: edit cells, rerun code, and see results alongside it.
- LLM-aided Rust rewrite: export a task, generate Rust, check it against Rank.
Project Euler #2: sum the even Fibonacci numbers. Start with 100, edit the limit to 4 million, press Ctrl-R. Answer: 4613732.
Requires Node.js 22.12 or newer, Python, and a C++20 build toolchain.
Open the REPL without a global install:
npx @arrrank/clinpx downloads the package to its cache on the first run.
For a permanent rank command:
npm install -g @arrrank/cli
rankOr run from source:
npm install
npm run build
npm run rankrank> use numbers
rank> 2 + 3 * 4
14
rank> 1 to 5 sum
15
Run a file, optionally passing inputs:
npx @arrrank/cli demos/euler/001_multiples.ra --limit 10npm test
npm run rank -- test demos/euler