Cloudflare's Rust TypeScript Port Matches tsc Error-for-Error, Then Diverges at the Exit Code
Teams get a real path to in-browser and worker-side TypeScript checking because Rust compiles to Wasm without Go's runtime, which TS7 cannot do. But switching CI to tsrs means revisiting exit-code assumptions and flag compatibility, and Windows-only workflows will have to wait for a later build.
Cloudflare and VoidZero shipped tsrs, a Rust port of the TypeScript compiler incubated in the Oxc toolchain. The port is not a fork: it translates the Go-based TypeScript 7 compiler function by function, and the compatibility rule is that Go code is the spec. In the official conformance suite, tsrs matches 13,458 of 13,462 error baselines, leaving four edge cases outside normal error scenarios.
On a 199-file project with six planted error categories, tsc 7.0.2 and tsrs 0.18.0 produced ten diagnostics that were character-identical, including four errors cascading from a generic-constraint inference fallback. The one observable difference sat in the process exit code: tsc returned 1, tsrs returned 2, and @tsrs/wasm also returned 2. On a 1-core 2G container, tsrs measured 1.8x to 2.2x faster than tsc, far from the official 8x, because process cold start consumes roughly half the runtime on small projects.
Wasm is where tsrs separates from TS7: @tsrs/wasm runs type checking in browsers and Cloudflare Workers using an in-memory filesystem and JSON diagnostics. The current release is single-threaded, lacks several tsc flags such as --init and --showConfig, ships no Windows or Intel Mac binaries, and tracks the 7.1.0-dev branch, so CI results can drift with upstream commits.
Treating the Go implementation as the spec makes tsrs credible; a port with nicer messages but different error ordering would be useless in CI.
Wasm shifts where type checking can execute, and the Go compiler's runtime cost closes that door for TS7.
Official speedups are measured where type checking dominates; on smaller projects, startup time makes the practical gain closer to 2x.
tsrs and TS7 are actively trading optimizations, so committing to either as the permanent compiler is premature.