Korr is a programming language for web backends, server-rendered full-stack
websites and command-line tools. You write .krr files with a small, readable
syntax; the korr program runs them, tests them and turns them into a single
executable you can copy to a server.
let app = http.app()
app.get("/", fn(req) => html"<h1>Hello, {req.query.name ?? "world"}!</h1>")
app.get("/api/time", fn(req) => { now: time.iso() }) // maps become JSON
if os.is_main()
app.listen(8080)
This page explains what Korr is good at, what it is not (yet) good at, and how it relates to Rust, the language it is written in. If you just want to start, go to Installation and Getting started.
| You want to build | Korr gives you |
|---|---|
| A JSON API | router with :params, JSON in/out, cookies, secure default headers, request simulator for tests |
| A server-rendered website | html"..." templates that escape user input, forms, cookies, static files |
| A database-backed app | SQLite (built in), PostgreSQL and MySQL/MariaDB with one API, parameters and transactions |
| A command-line tool | arguments, input, files, environment, .env, safe process execution, exit codes |
| Something to ship | korr build makes one executable, no Korr or dependencies needed on the target machine |
Interactive browser code (React-style UIs) is not Korr’s job today: Korr runs on the server. Pair it with plain JavaScript or htmx in the browser, or see the roadmap for plans to run Korr in the browser.
"{name}", no semicolons, no build configuration."1" + 1 is an error,
integer overflow and out-of-range indexes raise errors, HTML is escaped, SQL
values are parameters, os.exec never uses a shell.flowchart LR
A["main.krr"] --> B["lexer"] --> C["parser"] --> D["resolver"] --> E["compiler"] --> F["bytecode VM"] --> G["output"]
D -- "unknown names, wrong scopes" --> X["error, reported before anything runs"]
totl
stops the program with did you mean 'total'? before any code runs.x += 1, comparisons,
calls to known functions) get specialised instructions.unsafe code, every memory access is checked, and a Korr program cannot
crash the interpreter with a buffer overflow or use-after-free.korr build produces one executable; prebuilt Korr
releases need nothing installed (no runtime, no system libraries).Being honest about these helps you decide whether Korr fits your project. The roadmap lists the plans for each.
| Limitation | What it means for you |
|---|---|
| No threads in programs | The web server handles many requests at once with workers (app.listen(8080, { workers: 4 })), each with its own copy of the program, so data in variables is per worker. Programs themselves have no threads and no async/await yet; within one request everything runs in order. |
| Dynamic typing | Type annotations (fn f(n: int)) are checked when the code runs, not at compile time. Before the program runs, korr check catches syntax errors, unknown names and unhandled enum variants, but not type mistakes or wrong argument counts. |
| Interpreter speed | Over 23 benchmark cases Korr is 1.5x faster than CPython and about 1.6x slower than PHP 8.4; nothing comes close to Node.js’s JIT on numeric code. Function calls and objects are the slowest part (2 to 3x behind PHP). See Performance. |
| Reference cycles leak | Memory is reference-counted without a cycle collector: data structures that point to themselves (a parent holding a child that holds the parent) are not freed until the program exits. Avoid long-lived cycles in servers. |
| No HTTPS in the server | Put Caddy or Nginx in front for HTTPS. WebSockets and Server-Sent Events are built in. |
| Young ecosystem | Packages are Git repositories (no central registry yet). There is a formatter (korr fmt) and a full VS Code extension, but no language server for other editors and no debugger yet. |
| No browser runtime | Korr renders HTML on the server; browser-side code is JavaScript. |
Good fits today: internal tools, admin panels, APIs and websites (with workers, a laptop serves tens of thousands of small requests per second), prototypes, automation scripts, CLI utilities and real-time features (WebSockets, Server-Sent Events) with up to a few thousand open connections. Not a good fit yet: services that keep tens of thousands of connections open at once (each WebSocket uses a small thread), or CPU-heavy number crunching.
Korr is written in Rust, but a Korr program is not a Rust program, so Rust’s promises do not all carry over:
| Rust’s promise | In Korr today | Why |
|---|---|---|
| Performance: compiled to machine code, no runtime, no garbage collector | Korr has no garbage collector either, but your code runs on an interpreter, which is 10 to 100x slower than compiled Rust on tight loops. | Rust compiles ahead of time with full type information; Korr is dynamic and interpreted so that it starts instantly and stays simple. |
| Reliability: memory safety and thread safety proven at compile time | Memory safety: yes. Korr programs cannot corrupt memory, because the VM is safe Rust. Compile-time checks: names, scopes and exhaustive match on enums; types are checked at run time. Thread safety: Korr has no threads, so there are no data races, and no parallelism. |
A type checker and a concurrency model are large language features that are not built yet. |
| Productivity: great docs, friendly compiler errors, Cargo, editor tooling, formatter | Friendly errors, docs, a built-in test runner, bundler, package manager, formatter (korr fmt) and a VS Code extension with go to definition, rename and errors as you type: yes. Language server for every editor, debugger and a central registry: not yet. |
These are planned; see the roadmap. |
In short: Korr gives you Rust’s safety of the runtime (no crashes, no memory corruption, no undefined behaviour) with a much simpler language, and pays for that simplicity with interpreter speed and fewer compile-time guarantees. The roadmap closes the gap step by step: a concurrent server, optional static type checking and a language server.
| Docs index | Next: Installation |