Port of the TypeScript compiler, checker and lsp to Rust, by LLM
ts-rust (npm package tsc-rs) is a from-scratch Rust port of Microsoft's TypeScript compiler/checker/language server (typescript-go), produced almost entirely by LLM coding agents rather than hand-written. The author first spent over $400,000 in API tokens running GPT-5.6 Sol and GPT-6 Astra in long agentic '/goal' loops, which wrote 1.3M lines of Rust but plateaued at ~84% compatibility; switching to Claude Opus 5.5 produced a working version in 10 hours and, after ~$24,000 of further API spend over two weeks, reached 100% compatibility on tested real-world projects while passing all 181,711 ported Go baseline tests. Benchmarks show the Rust port running about 1.6x faster than the Go tsc 7 compiler (though slower than Bun's native `bun check`) across dozens of open-source codebases including VS Code, TanStack Query, Sentry and T3 Code.
What it claims
tsc-rs is a Rust port of Microsoft's Go TypeScript compiler that keeps Go's algorithms and behaviour and exposes the same tsc command line, language server and API. The author says they have "never read a line of this code" and warns they have "no idea if this will actually work." They call it an early release that "should work as a drop in replacement for the vast majority of apps."
The port is pinned to a single upstream revision: microsoft/TypeScript 673a5f17d713 (2026-09-29, TypeScript 7.1.0-dev). When you compare its output, compare against typescript@7.1.0-dev.20260929.1, not 7.0.x or @typescript/native-preview. Errors that 7.0.2 does not report but tsc-rs does are often new 7.1 checks.
Evidence
- Correctness. All 181,711 ported Go tests pass. TanStack Query core and Hono produce diagnostics identical to Go's. LSP and API answers match Go on the "oracle test sets."
- Divergence on 120 repos. Command-line output differs from Go only in the known problems listed below, or where Go's own output varies between runs.
- Type-check speed, 60 projects. tsc-rs takes about half of Go's time (geometric mean). That figure is for a measured build with PGO and BOLT. The npm preview packages are built without them and are slower.
- Six apps, against the native tsc 7. The test machine was an Apple M4 Pro (12 cores, 48 GB). Each result is the hyperfine median of 5 runs after 1 warmup, with
--noEmit --incremental falseand native binaries. tsc-rs is 1.61× faster than tsc 7.0.2, andbun checkis 2.95× faster. Bun wins on every app except tRPC. - Error counts.
- Bun reports errors no other checker reports: 3 on Sentry and 2 on tRPC.
- tsc-rs reports 10 errors on VS Code and 2 on Sentry. TypeScript 7.1.0-dev reports the same errors line for line.
- T3 Code, an Effect project. Without Effect diagnostics,
bun checkis fastest. With them, tsc-rs needs only one pass because Bun lacks the Effect diagnostics. tsc-rs, tsc 7 +@effect/tsgo, and the effect-tsgo diagnostics pass all report the same 221 Effect diagnostics.
How to use it
npm install -D tsc-rs
npx tsc-rs -p tsconfig.json- Options and packaging. tsc-rs takes the same options as
tsc. The package is namedtsc-rsso it does not clash withtypescript. Each release also ships a standalone per-platform archive containing thetscbinary and the lib files. - Platforms. Linux x64 (static, any distribution) and macOS arm64. Windows and Linux arm64 are not available yet.
- VS Code. See the npm package README.
- WASM. There is a WebAssembly build in
crates/ts_wasm(npm/wasm). - Effect diagnostics are built in. These are codes 377xxx, ported from Effect-TS/tsgo 0.46.1. They run only when the tsconfig declares the plugin: ``
{ "compilerOptions": { "plugins": [{ "name": "@effect/language-service" }] } }`` The Effect editor features (quick fixes, refactors, hover, completions) are not ported.
To build from source and run the Go baseline tests:
./scripts/run-cargo-capped.sh build --release -p ts_goport --bins
./scripts/verify.sh
TS_GO_REPO=/path/to/typescript-go ./scripts/run-cargo-capped.sh test -p ts_goport --test go_baselinesThe benchmark scripts are in scripts/bench-apps (setup.sh, run.sh, summary.py, t3code.sh). The porting rules are in crates/ts_goport/PORTING.md, and the agent work rules are in AGENTS.md.
Cost. The author estimates the port "could probably have done it for ~$20k." The Opus run cost about $24,047. On Claude subscriptions, that worked out to 925–983% of the $200 plan's weekly limits.
Limits
- Monorepo TS6059. In some monorepos, a workspace package's sources are reachable both via
node_modulesand via a direct import. There, tsc-rs may emit more files and report TS6059 (file not underrootDir). Go'stscdecides this by timing, so its result varies between runs. tsc-rs always gives TypeScript 6's result. tsc -bstale reads. If one project imports another's output without a project reference, tsc-rs can read stale or missing output (TS2305/TS2307). This happens in specific cases:noEmitOnErrorprojects- non-incremental
noCheckprojects - some large projects that only write outputs with the default builders
- a reader project that references another project which builds before the writer
The fix is to add the project reference.
- LSP memory. Memory grows about 20 MiB per 1,000 edits. It starts 12–24% above
tsc, then stays belowtscfrom around edit 20, in sessions measured up to 2,190 edits. - Version string.
tsc-rs --versionprints 7.1.0-dev, not the npm version, andtypesVersionsmatching uses 7.1.0-dev. - Benchmark setup changes. Several apps needed config changes to type-check cleanly under TS 7:
- Excalidraw:
baseUrlremoved - TypeORM:
moduleResolutionchanged fromnodetonodenext - VS Code: added electron typings
- Playwright: generated sources
rxjs and date-fns were excluded from the benchmark.
- Who wrote it. Everything in the README after the author's intro was written by LLMs.
- Licence. MIT, keeping TypeScript's Apache-2.0 and the Go standard library's BSD-3-Clause notices (see NOTICE.md).
Organisations named here
- Microsoft
- OpenAI
- Anthropic
- Effect-TS
- Bun
- TypeSafe
Technologies named here
- tsc-rs
- GPT-5.6 Sol
- Claude Code
- GPT-6 Astra
- Bun
- Claude Opus 5.5
- @effect/language-service
- hyperfine
- typescript-go
- Rust
- TypeScript
- WebAssembly
- npm
- Playwright
- VS Code
- Go
Related in coding-agents
