0021. TypeScript everywhere; Rust only for a profiled hot job
Source:
docs/decisions/0021-typescript-not-rust.md. Generated at build time; edit the source file.
Date: 2026-11-21 Status: Accepted
Context
Section titled “Context”Chess logic is CPU-heavy, which raises the question of writing it in Rust. Rust chess libraries (shakmaty, pgn-reader) are strong, but they are GPL-licensed, which would constrain how the product can be distributed.
Decision
Section titled “Decision”Write all application and chess code in TypeScript. Consider Rust only for a specific batch job that profiling shows to be a bottleneck, and check the licence before using any chess crate.
Alternatives considered
Section titled “Alternatives considered”A Rust core compiled to WASM or native; a Python core.
Consequences
Section titled “Consequences”One language and one toolchain, with shared types end to end. Pure-JS chess code is slower than Rust, which we accept until a profile says otherwise. The Rust option stays open for isolated batch work.
See ADR 0001.