Skip to main content

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
  1. Getting Started — install, first program, first output
  2. Concepts — design principles: immutability, graph evaluation, determinism, providers
  3. Language reference — types, bindings, functions, imports, stdlib
  4. Output and manifests — single-document output, std::Emit<T>, Emit::manifest(...), and --file-root
  5. Errors and diagnostics — what fails when, and how to read diagnostics
  6. CLI reference — all commands and flags with examples
  7. Faker provider — generating typed fake data
  8. Dependencies — reusable packages from local paths, npm registries, and git
  9. 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.