corsa_runtime 0.40.1

Small executor, task primitives, and broadcast channels for corsa
Documentation

corsa-bind is a multi-crate workspace for talking to Corsa (the native TypeScript 7 implementation line) from Rust and JavaScript runtimes. Hot paths live in Rust and stay zero-cost; napi-rs, Rustler, and a shared C ABI carry that performance to JS/TS, Elixir, C, C++, Go, Zig, C#, Swift, and MoonBit — so you can author custom checker tooling and lint rules without reimplementing the checker.

[!WARNING] This repository is still evolving. The local Rust and Node API/LSP surfaces are hardened for production-style use, but distributed orchestration stays behind the experimental-distributed cargo feature and some upstream-facing endpoints remain explicitly experimental.

[!IMPORTANT] corsa-bind is built around upstream-supported Corsa workflows. We follow Corsa's recommended stdio/API/LSP integration points, keep ref/corsa-upstream as an exact upstream checkout, and preserve a strict no forks, no patches policy.

Quick start

Enter the Nix dev shell and build the workspace:

nix develop
vp install
vp run -w build

A first program in Rust — no Corsa binary required:

use corsa::{
    lsp::{VirtualChange, VirtualDocument},
    runtime::block_on,
};
use lsp_types::{Position, Range};

fn main() -> Result<(), corsa::CorsaError> {
    block_on(async {
        let mut doc =
            VirtualDocument::untitled("/virtual/minimal.ts", "typescript", "const answer = 41;\n")?;
        doc.apply_changes(&[VirtualChange::splice(
            Range::new(Position::new(0, 15), Position::new(0, 17)),
            "42",
        )])?;
        Ok(())
    })
}
cargo run -p corsa --example minimal_start

The Getting started guide covers the Node.js and type-aware Oxlint entry points and how to run against the real pinned Corsa binary.

Documentation

Full guides live under docs/:

Guide What it covers
Getting started First program in Rust, Node.js, and Oxlint
Architecture Workspace shape, upstream policy, extension points, naming
Node.js binding @corsa-bind/napi for Node, Deno, and Bun
Language bindings Native bindings for Elixir, C, C++, Go, Zig, C#, Swift, MoonBit
Type-aware Oxlint corsa-oxlint rule authoring, native and stylistic rules
Native rules The type-aware Rust lint rules and their options
Stylistic rules The Rust-backed @stylistic-compatible formatting rules
Stylistic benchmark Native stylistic throughput vs the upstream @stylistic
Performance Benchmark entry points and measured numbers
CI and local checks Reproduce the GitHub checks locally
Production readiness Runtime controls and release gates
Support policy Supported platforms, bindings, and experimental scope

The generated documentation site starts at docs/index.md and is built with vp run -w docs_build.

Status

  • License: MIT
  • Upstream: ref/corsa-upstream is pinned by exact commit in corsa_ref.lock.toml, with no local patching
  • Default transport: SyncMsgpackStdio (msgpack-first)
  • Runtime: custom in-house runtime, no tokio
  • Published packages: @corsa-bind/napi and corsa-oxlint (both expect a caller-provided Corsa executable)
  • Distributed orchestration: behind the experimental-distributed cargo feature

Public APIs are still 0.x, so treat compatibility as conservative. See Known limitations for the current experimental scope.

Sponsors

CI/CD runners for this project are supported by Blacksmith.