Introduction
Rank is a declarative, deterministic, finite configuration language for generating structured outputs such as JSON and YAML.
Write a program that describes your output. Run it. Get the same result every time.
Use Rank when you want typed configuration, reproducible data transforms, provider-backed reads, or explicit mutation plans without hidden runtime state.
If you want installation and a first program, continue to Getting Started. If you want the mental model first, read Concepts. For runnable reference programs, browse Examples.
Quick start
npm install -g @rank-lang/cli
// src/main.rank
Config = Object { host: string, port: number }
config: Config = {
host: `api.example.com`,
port: 8080,
}
pub main = || config
rank src/main.rank
host: api.example.com
port: 8080
Use --format json when you want JSON on stdout instead:
rank src/main.rank --format json
Recommended reading order
- Getting Started — install, first program, first output
- Concepts — design principles: immutability, graph evaluation, determinism, providers
- Language reference — types, bindings, functions, imports, stdlib
- Output and manifests — single-document output,
std::Emit<T>,Emit::manifest(...), and--file-root - Errors and diagnostics — what fails when, and how to read diagnostics
- CLI reference — all commands and flags with examples
- Faker provider — generating typed fake data
- Dependencies — reusable packages from local paths, npm registries, and git
- Provider authoring — writing and publishing your own provider
LLM-friendly docs
For AI assistants, retrieval pipelines, and offline ingestion, the docs build also publishes:
- llms.txt — top-level index of the docs corpus
- llms-full.txt — one combined markdown-oriented bundle
- llms-examples.txt — curated runnable examples bundle, including the S3 Logs task-oriented example
For the language specification and implementation internals, see Spec and plan.