{"slug": "rust-port-of-typescript-tsc", "title": "Rust Port of TypeScript (Tsc)", "summary": "A Rust port of Microsoft's native TypeScript compiler, called ts-rust and published to npm as tsc-rs, was built largely by LLMs, with Anthropic's Opus 5.5 producing a working v0 in 10 hours after OpenAI's GPT-5.6 Sol and GPT 6 Astra spent over $400,000 in API-priced tokens and months of /goal loops without passing roughly 84% compatibility. The final Opus 5.5 run cost about $24,047 in API spend over two weeks, equal to between 925% and 983% of a $200 weekly Claude plan limit, and the project reports 100% compatibility on every real-world project tested plus all 181,711 ported Go tests passing. The port is pinned to microsoft/TypeScript commit 673a5f17d713 (2026-09-29, TypeScript 7.1.0-dev) and ships for Linux x64 and macOS arm64, with Windows and Linux arm64 not yet available.", "body_md": "I wanted to see if LLMs could port the TypeScript compiler, checker and lsp to Rust. Turns out they can.\n\nIt [cost over $420,000](#how-did-this-go) in tokens to do it, but you could probably have done it for ~$20k (see below)\n\n- Test model capabilities\n- Make a fast TypeScript type checker\n- Make a ts checker that can work in WASM with high performance\n- Memes\n\n**This is an early release.** It has 100% compatibility in every real world project we have\ntested. It should work as a drop in\nreplacement for the vast majority of apps. See [Known problems](#known-problems).\n\nAlso worth mentioning: I've never read a line of this code.\n\nBe warned, I have no idea if this will actually work.\n\n```\nnpm install -D tsc-rs\nnpx tsc-rs -p tsconfig.json\n```\n\nI used a lot of OpenAI models to try and complete this port. In total I did **over $400,000 in API priced tokens with GPT-5.6 Sol and GPT 6 Astra**. They wrote over 1.3m lines of Rust over multiple months of /goal loops and never got past like 84% compat.\n\nWhen I saw how little my Claude Code limits were burning, I figured it'd be fun to throw Opus 5.5 at this. It had a working v0 in 10 hours.\n\nI assumed it kept using the code the Codex models wrote. I was wrong. **Opus 5.5 started from scratch. It got further than Astra in 1/10th the time.**\n\nI let it keep going, and it definitely did. Total token spend was **~$24,047 of API spend over 2 weeks**. I was using my Claude accounts, and it worked out to somewhere between **925% and 983% of my $200 plan weekly limits**.\n\nExpensive, for sure, but not that bad considering how much work has went into typescript-go.\n\nEverything below this was written by my LLMs, not me.\n\nts-rust is a direct port of Microsoft's native TypeScript compiler, which is written in Go\n([microsoft/TypeScript](https://github.com/microsoft/TypeScript), formerly\n[typescript-go](https://github.com/microsoft/typescript-go)). It keeps Go's algorithms and\nbehavior and has the same command line (`tsc`), language server and API.\n\n```\nnpm install -D tsc-rs\nnpx tsc-rs -p tsconfig.json\n```\n\n`tsc-rs` takes the same options as `tsc`. The npm package is `tsc-rs` so that it does not clash\nwith the `typescript` package. Each [release](https://github.com/pingdotgg/ts-rust/releases) also\nhas a standalone archive per platform: the `tsc` binary with the lib files next to it.\n\nPlatforms: Linux x64 (static, any distribution) and macOS arm64. Windows and Linux arm64 are not available yet.\n\nTo use it in VS Code, see the [npm package README](https://github.com/pingdotgg/ts-rust/blob/main/npm/tsc-rs-readme.md#vs-code).\n\n`tsc-rs` has the [Effect](https://effect.website) language service diagnostics built in (codes\n377xxx), so an Effect project needs no second compiler. They come from the same check as the\nTypeScript diagnostics, and the language server shows them too. They run only when the tsconfig has\nthe plugin, as with `@effect/language-service`:\n\n```\n{ \"compilerOptions\": { \"plugins\": [{ \"name\": \"@effect/language-service\" }] } }\n```\n\nThe rules, options and `@effect-diagnostics` comments are a port of\n[Effect-TS/tsgo](https://github.com/Effect-TS/tsgo) 0.46.1. The editor features of the language\nservice (quick fixes, refactors, hover, completions) are not ported.\n\nThe port is pinned to one upstream revision, microsoft/TypeScript\n[`673a5f17d713`](https://github.com/microsoft/TypeScript/commit/673a5f17d713bdc8c7185f18a9c11e3c4ac5d781)\n(2026-09-29, TypeScript 7.1.0-dev; [UPSTREAM.md](https://github.com/pingdotgg/ts-rust/blob/main/UPSTREAM.md)), and compared with Go at that\nrevision. To compare, use `typescript@7.1.0-dev.20260929.1`, not 7.0.x or\n`@typescript/native-preview`. A difference that this build also shows is upstream behavior, and it\ngoes away when the port moves to a newer pin.\n\n- **Same results.** TanStack Query core and Hono check with diagnostics identical to Go's. All\n181,711 ported Go tests pass. The language server and API answers match Go on the oracle test\nsets.\n- **Faster.** On 60 open-source projects, type checking takes about half of Go's time (geometric\nmean). The preview packages are built in CI without PGO and BOLT, so they are slower than that\nmeasured build.\n- **Real projects.** On 120 open-source repos, the command-line output differs from Go's only in\nthe problems below and where Go's own output changes from run to run.\n\nFull type check of [T3 Code](https://github.com/pingdotgg/t3code), compared with `tsc` 6, `tsc` 7\nand the new `bun check` in Bun. T3 Code uses Effect, so there are two cases: without the Effect\ndiagnostics and with them. Each time is the sum for the five T3 Code projects. Lower is faster.\n\n**Without Effect diagnostics**\n\n| Checker | Time | vs `tsc` 6 | vs `tsc` 7 |  | \n|---|---|---|---|---|\n| `bun check` | 4.07s | 15.4× | 3.95× faster | `█` | \n| `tsc-rs` | 7.25s | 8.6× | 2.22× faster | `██` | \n| `tsc` 7 | 16.10s | 3.9× | baseline | `█████` | \n| `tsc` 6 | 62.63s | baseline | 3.89× slower | `██████████████████` | \n\n**With Effect diagnostics**\n\n| Checker | Time | vs `tsc` 6 | vs `tsc` 7 + Effect |  | \n|---|---|---|---|---|\n| `tsc-rs` (Effect built in) | 11.13s | 12.5× | 1.89× faster | `███` | \n| `tsc` 7 +`@effect/tsgo` | 21.07s | 6.6× | baseline | `██████` | \n| `bun check` , then`effect-tsgo diagnostics` | 37.60s | 3.7× | 1.78× slower | `███████████` | \n| `tsc` 6 +`@effect/language-service` | 138.63s | baseline | 6.58× slower | `████████████████████████████████████████` | \n\n`bun check` is the fastest when you do not need the Effect diagnostics. It does not have them, so\nan Effect project needs a second pass. `tsc-rs` gets them from its one check.\n\nErrors. `tsc-rs`, `tsc` 7 + `@effect/tsgo` and the `effect-tsgo diagnostics` pass report the same\n221 Effect diagnostics. `tsc` 6 uses the JavaScript Effect plugin\n(`@effect/language-service` 0.87.4), which has a different rule set: it reports 287 on\n`apps/server` where the others report 177. `tsc-rs` and `tsc` 6 report one more error, TS2322 in\n`apps/server/scripts/record-pi-rpc-replay-fixture.ts`. TypeScript 7.1.0-dev reports it too, and\n[pingdotgg/t3code#16704](https://github.com/pingdotgg/t3code/pull/16704) fixes it.\n\nHow it was measured: the same machine and method as the real-world apps below, with\n`--composite false` added (`apps/web` is composite). T3 Code at\n[`cd41c4ad`](https://github.com/pingdotgg/t3code/tree/cd41c4ada0c70cc2eec95ecd7266f3dab010c58c),\nprojects `apps/server`, `apps/web`, `apps/mobile`, `packages/client-runtime` and\n`packages/shared`. Without Effect, the configs have no Effect plugin. With Effect, `tsc` 7 is the\nEffect-patched 7.0.2 from `@effect/tsgo` 0.46.1, and `tsc` 6 is 6.0.3 patched with\n`@effect/language-service`. The script is\n[scripts/bench-apps/t3code.sh](https://github.com/pingdotgg/ts-rust/blob/main/scripts/bench-apps/t3code.sh). The `tsc-rs` switch in T3 Code is\n[pingdotgg/t3code#16704](https://github.com/pingdotgg/t3code/pull/16704).\n\nFull type check of six open-source apps with `tsc` 6 (the JavaScript compiler), `tsc` 7 (the Go\ncompiler), `tsc-rs` and `bun check`. The multiplier is the speedup over `tsc` 6. Lower times are\nfaster.\n\n| App | Lines checked | `tsc` 6 | `tsc` 7 | `tsc-rs` | `bun check` | \n|---|---|---|---|---|---|\n| [VS Code](https://github.com/microsoft/vscode/tree/3f07e1aba32acacb8b08ae91bfdc954b580ad1fd) | 3.75M | 54.56s | 6.84s (8.0×) | 4.20s (13.0×) | 1.62s (33.7×) | \n| [Sentry](https://github.com/getsentry/sentry/tree/8294650589dbd26f230c73f4ab26b62a68aede8f) (frontend) | 2.11M | 58.76s | 7.90s (7.4×) | 4.46s (13.2×) | 3.14s (18.7×)* | \n| [Playwright](https://github.com/microsoft/playwright/tree/d469960fdfc461e2d5795a3fa48a58a52a91ecaf) | 585k | 4.48s | 0.66s (6.8×) | 0.34s (13.2×) | 0.18s (25.0×) | \n| [Excalidraw](https://github.com/excalidraw/excalidraw/tree/53973c3a423fbd75a4ce68107786b4fcb90e4968) | 449k | 5.32s | 0.80s (6.7×) | 0.70s (7.6×) | 0.18s (29.0×) | \n| [TypeORM](https://github.com/typeorm/typeorm/tree/c64a1f052fc39f6688b6b73b83d065d7147ba8bb) | 386k | 3.86s | 0.55s (7.0×) | 0.36s (10.7×) | 0.19s (20.0×) | \n| [tRPC](https://github.com/trpc/trpc/tree/d756e591a5e37ef20b8d75ecd4d736c195497289) (server package) | 209k | 1.10s | 0.16s (6.8×) | 0.09s (12.0×) | 0.12s (9.1×)* | \n| **Geometric mean** |  |  | **7.1×** | **11.4×** | **20.9×** | \n\nCompared with `tsc` 7, `tsc-rs` is 1.61× faster and `bun check` is 2.95× faster (geometric\nmeans). `bun check` is the fastest on every app except tRPC.\n\n* `bun check` reports errors that no other checker reports: 3 on Sentry and 2 on tRPC.\n\nEach config checks with 0 errors under `tsc` 7.0.2. The other differences:\n\n- `tsc-rs` reports 10 errors on VS Code and 2 on Sentry. TypeScript 7.1.0-dev (`typescript@next` )\nreports the same errors, line for line.`tsc-rs` ports a 7.1 dev revision, which has checks that\n7.0.2 does not have.\n- `tsc` 6 reports 9 errors on VS Code.\n\nHow it was measured: Apple M4 Pro (12 cores, 48 GB), macOS 26.5.1. [hyperfine](https://github.com/sharkdp/hyperfine),\nmedian of 5 runs after 1 warmup run, with `--noEmit --incremental false`. Each checker uses its\ndefault thread count. `tsc` 7 and `tsc-rs` run as native binaries, without the npm launcher.\n`tsc` 6 runs on Node 24.19 with a 16 GB heap, because it runs out of memory on VS Code and Sentry\nwith the default heap. Versions: `tsc-rs` 0.1.0, TypeScript 7.0.2 and 6.0.3, Bun canary\n`bd599f5af`. Lines checked is the `tsc` 7 `--extendedDiagnostics` count, with the `.d.ts` files.\nThe T3 Code benchmark above uses the same machine and method.\n\nFour apps needed changes to check with 0 errors under `tsc` 7. Nothing else changed:\n\n- Excalidraw: no `baseUrl` , because TS 7 removed it.\n- TypeORM: `moduleResolution` changed from`node` to`nodenext` , because TS 7 removed`node` .\n- VS Code: the `electron` typings that its postinstall adds.\n- Playwright: the sources that its build generates.\n\nTwo apps are not in the table:\n\n- rxjs main needs its workspace packages built first.\n- date-fns uses project references. There, `tsc -p` and`bun check` do different work.\n\nThe scripts are in [scripts/bench-apps](https://github.com/pingdotgg/ts-rust/blob/main/scripts/bench-apps): `setup.sh <dir>`, then\n`run.sh <dir>` and `summary.py <dir>`, and `t3code.sh <dir>` for T3 Code.\n\n- In some monorepos, the source files of a workspace package are reachable both through\n`node_modules` and through a direct import. There,`tsc-rs` can write output for more of those\nfiles than`tsc` does.\n- In `tsc -b` , when one project imports the output of another project without a project reference,`tsc-rs` can report TS2307 (cannot find module) where`tsc` happens to build the other project\nfirst. Add the reference to fix it.\n- `tsc -b --watch` can stop with an internal error (exit code 70) after some edits.\n- In the editor, memory grows slowly during long edit sessions.\n- `tsc-rs --version` prints the TypeScript version that it ports (7.1.0-dev), not the npm\nversion. The compiler matches`typesVersions` against it.\n\n`crates/ts_goport` is the compiler. It has two parts crates, `goport_util` and `goport_lsproto`,\nin `crates/ts_goport/parts`, and uses the lib files in `crates/ts_goport/libs`.\n`tools/ts_ast_codegen` generates `crates/ts_goport/src/astdata`, and\n`tools/ts_diagnostics_codegen` generates `crates/ts_goport/src/diagnostics/catalog.rs` and\n`crates/ts_goport/src/diag.rs`. `crates/ts_wasm` is the WebAssembly build\n([npm/wasm](https://github.com/pingdotgg/ts-rust/blob/main/npm/wasm/README.md)).\n\n```\n./scripts/run-cargo-capped.sh build --release -p ts_goport --bins\n./scripts/verify.sh\n```\n\nThe bins are `goport` (type check) and `tsgo` (the Go `tsgo` command line). The Go baseline tests\nrun with\n`TS_GO_REPO=/path/to/typescript-go ./scripts/run-cargo-capped.sh test -p ts_goport --test go_baselines`.\n\n- Port rules: [crates/ts_goport/PORTING.md](https://github.com/pingdotgg/ts-rust/blob/main/crates/ts_goport/PORTING.md)\n- Measurement and gate scripts: [scripts/goport](https://github.com/pingdotgg/ts-rust/blob/main/scripts/goport/README.md)\n- npm packages and releases: [npm/README.md](https://github.com/pingdotgg/ts-rust/blob/main/npm/README.md)\n- Typechecker work rules: [AGENTS.md](https://github.com/pingdotgg/ts-rust/blob/main/AGENTS.md) , the[accountability rules](https://github.com/pingdotgg/ts-rust/blob/main/docs/typechecker-accountability.md) and the[saved state](https://github.com/pingdotgg/ts-rust/blob/main/docs/typechecker-state/current.json)\n- How the project started: [docs/history.md](https://github.com/pingdotgg/ts-rust/blob/main/docs/history.md)\n\nPush a tag `v<version>` (for example `v0.1.0`). The\n[release workflow](https://github.com/pingdotgg/ts-rust/blob/main/.github/workflows/release.yml) builds, packs and tests the packages, publishes\nthem to npm and creates a GitHub release. A stable version goes to the dist-tag `latest`, and a\nprerelease version (`v0.2.0-beta.1`) to `next` and a GitHub prerelease. See\n[npm/README.md](https://github.com/pingdotgg/ts-rust/blob/main/npm/README.md#tsc-rs-releases).\n\n[MIT](https://github.com/pingdotgg/ts-rust/blob/main/LICENSE). The port keeps the licenses and notices of the code it ports: TypeScript\n(Apache-2.0) and parts of the Go standard library (BSD-3-Clause). See [NOTICE.md](https://github.com/pingdotgg/ts-rust/blob/main/NOTICE.md).", "url": "https://wpnews.pro/news/rust-port-of-typescript-tsc", "canonical_source": "https://github.com/pingdotgg/ts-rust", "published_at": "2026-10-08 00:46:00+00:00", "updated_at": "2026-10-08 00:48:59.413355+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models", "ai-tools"], "entities": ["ts-rust", "tsc-rs", "Microsoft", "TypeScript", "OpenAI", "GPT-5.6 Sol", "GPT 6 Astra", "Opus 5.5"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/rust-port-of-typescript-tsc", "markdown": "https://wpnews.pro/news/rust-port-of-typescript-tsc.md", "text": "https://wpnews.pro/news/rust-port-of-typescript-tsc.txt", "jsonld": "https://wpnews.pro/news/rust-port-of-typescript-tsc.jsonld"}}