All notable changes to Korr are listed here. The format follows Keep a Changelog and versions follow Semantic Versioning (before 1.0, minor versions may contain breaking changes).
setup-korr GitHub Action: uses: refkinscallv/korr@v0.13.1 installs Korr in
a CI job on Linux, macOS or Windows, checking the download against the
release’s SHA256SUMS.txt.ghcr.io/refkinscallv/korr (linux/amd64 and linux/arm64), built
by every release from the static binaries; runs as an unprivileged user.tests/security.rs: end-to-end security checks against real servers, run in
CI on all systems; scripts/release-check.sh runs every release gate (bugs,
security, documentation, benchmarks).bench/run.py warns when the middle runs of a case differ by more than 25%,
and bench/results.json keeps the time of every run. The four shortest cases
(concat, split_join, search_replace, regex) do more work so that every
case runs for at least about 10 ms; their numbers are not comparable with
earlier results.Real-time web: WebSockets, Server-Sent Events and publish/subscribe, plus CORS, rate limiting and a server that no slow client can hold up.
app.ws(path, { open, message, close }) with ws.send,
ws.close, ws.subscribe, ws.unsubscribe, ws.data and ws.request.
Strict by default: browser connections only from the same host (origins to
allow others), masked frames, valid UTF-8, a 1 MB message limit
(max_message), pings every 15 seconds; before hooks and the session apply.http.sse(topics) and the connection
stays open.http.publish(topic, message, event?): sends to every WebSocket and SSE
subscriber of a topic, in every worker.app.cors({ origins, methods, headers, expose, credentials, max_age }):
answers preflight requests and adds the CORS headers for allowed sites;
"*" with credentials is refused.app.rate_limit({ requests, per, paths }): a token bucket per client
address, counted once for all workers; 429 with Retry-After.app.trust_proxy(true): req.ip and rate limiting use the address the
reverse proxy put in X-Forwarded-For.bench/http/run.sh. At most 1,024 requests wait for a worker;
beyond that the server answers 503.The web server handles many requests at once.
app.listen(8080, { workers: 4 }) (or workers: "auto", or
the KORR_WORKERS environment variable) serves several requests at once.
Each worker is a thread with its own copy of the program, so workers share no
data and data races are impossible. The first worker runs the program up to
listen before the others start. On a laptop: about 5,100 requests per second
with 1 worker, 19,500 with 4, 27,900 with 8 (bench/http/run.sh).http.worker_id(): 0 for the first worker, 1, 2, … for the others.app.listen(port, { host, workers }) options map; unknown options are errors.bench/http/: an HTTP load generator and a script measuring requests per
second for 1, 2, 4 and 8 workers.sqrt(x), 60 to
35 ns) and through a module (math.sqrt(x), about 100 to 60 ns, with an inline
cache for the lookup). Reading a map’s field (config.port) uses the same
cache. The n-body benchmark is 1.15x faster.A speed release: Korr is now faster than CPython overall and much closer to
PHP 8.4, still in safe Rust and with every check in place. Measured with
python3 bench/run.py (23 workloads, see bench/RESULTS.md).
s += "x" in a loop is amortised O(1) instead of
copying the whole string each time (building a 200 KB string: 1.3 s to 4 ms).
A string that is shared with another variable, array, map or closure is never
changed; a new one is built as before.Point(x: 1, y: 2)) avoid temporary arrays and lists (1.4x faster).for v in array writes the loop variable directly and no longer copies the
iterator for every element.join, json.encode and json.decode avoid per-item copies; decoding shares
repeated object keys (JSON 2x faster in total).fast-alloc feature, on by
default): string- and collection-heavy programs 1.2 to 3x faster. Peak memory
is about 2 MB higher for small programs and up to 1.6x higher for programs
that grow very large arrays. cargo build --no-default-features builds
without it.korr disasm <file> prints the bytecode of every function (for work on the
compiler and VM).bench/profile/profile.sh: a sampling profiler built on gdb, for machines
where perf is not available.A release for command-line programs and for the editor, with enums as the first step towards a safer language.
enum Shape { Circle(r: float), Rect(w: float, h: float), Empty },
variant patterns in match (Shape.Circle(r)), methods with impl, and checks
before the program runs: unknown variants, wrong pattern arity, and a match
that does not handle every variant.cli.parse(spec): command-line options and arguments with types, defaults,
required options, generated --help and errors with exit code 2;
cli.usage(spec).term module: bold, dim, italic, underline, colours, strip, is_tty,
width; honours NO_COLOR and FORCE_COLOR.fs.walk(dir) (every file below a folder) and fs.glob(pattern) (*, ? and
**).korr fmt [--check] [paths]: the official code style (indentation, spacing
around operators and after commas, trailing whitespace, blank lines). It never
changes the meaning of a program: the tokens before and after must be equal.
korr fmt - formats standard input. CI checks the repository with it.korr check --json: errors as JSON, for editors and other tools.korr setup --vsix <file>: write the VS Code extension package to a file.s.split(sep?: str, limit?: int) -> array, with a Parameters list);
Go to / Peek Definition (built-ins open a typed declaration file), Find All
References, Rename Symbol, Format Document, Go to Symbol and the Outline view,
highlighting of the name under the cursor, errors underlined as you type with
did you mean quick fixes; settings korr.path and korr.diagnostics.python3 bench/run.py writes bench/RESULTS.md.korr setup did not install the VS Code extension on Windows when VS Code was
installed but its code command was not on the PATH, and VS Code did not always
pick up an extension copied into its folder. Setup now builds a .vsix package
and installs it with the editor’s own command, finding VS Code, VS Code
Insiders, VSCodium, Cursor and Windsurf in their default install folders. CI
installs the extension into a real VS Code on Windows, macOS and Linux.korr setup failed to update the VS Code extension while VS Code was open
(“Please restart VS Code before reinstalling”), because it deleted the old
extension folder before running the editor’s installer. It now leaves the
editor’s folders alone and only removes copies of other versions that the
editor does not list. Editor errors are shown as one line.The first release with a codename (rocks and minerals, A to Z).
multipart/form-data bodies fill req.form and req.files
(safe file names, save(path), text()); app.request(..., { files }) in tests.app.sessions(secret, options) gives req.session, stored in an
HMAC-signed cookie (HttpOnly, SameSite=Lax, optional Secure).req.csrf_field, req.csrf_token, or an x-csrf-token header).validate(data, rules): type conversion, required/optional fields, min,
max, in, email, url, date; returns only declared fields.conn.migrate(dir): numbered SQL migrations, each in a transaction.map.clear().korr version shows the codename.docs/internals/: architecture, the compilation
pipeline, values and memory, standard library, web server, databases, tooling,
testing, releases.scripts/check-docs.py checks links and code blocks in the documentation.src/syntax, src/compiler,
src/runtime, src/stdlib, src/tools, src/cli.korr-linux-*-musl) that run on any distribution,
including Alpine and releases older than glibc 2.34; install.sh picks them
automatically.install.sh installs missing requirements after asking (Git; for source builds
a C compiler and Rust through rustup) and always builds with the latest stable
Rust (rustup update stable). New options: --source, --static, --yes,
--no-rust-update. install.ps1 offers to install Git with winget.ROADMAP.md.korr init, korr add github:user/repo@version,
korr install, korr remove, korr list. Packages are Git repositories
installed into korr_modules/, pinned in korr.lock and imported with
import "name"; korr build bundles them.__dir__ no longer use the \\?\ form, so
"{__dir__}/public", static files and file APIs work.macos-latest.korr setup: installs korr on the PATH and adds editor support; release
files named korr-setup-* run it on start.install.sh (Linux, macOS; source or prebuilt) and install.ps1
(Windows), and GitHub release builds for Linux, macOS and Windows.bench/suite.sh).korr build find files next to the executable
(__dir__ is the executable’s folder) wherever they are started from.