← Все новости

Cloudflare и VoidZero представили tsrs — порт компилятора TypeScript на RustCloudflare and VoidZero unveil tsrs, a Rust port of the TypeScript compiler

Экспериментальный tsrs развивается внутри тулчейна Oxc и, по замерам авторов, проверяет типы до 8 раз быстрее TypeScript 7.0 при расходе памяти на 70% меньше. Это не форк: язык по-прежнему развивает команда TypeScript, а часть оптимизаций уже ушла в TypeScript 7.1.The experimental tsrs lives in the Oxc toolchain and, by its authors' benchmarks, type-checks up to 8x faster than TypeScript 7.0 with about 70% less memory. It is not a fork: the TypeScript team still owns the language, and some optimizations already landed in TypeScript 7.1.

20 октября Cloudflare анонсировала tsrs — порт компилятора TypeScript на Rust. Проект начал Макс Швенк из Owner.com, теперь его ведут Cloudflare и VoidZero, а инкубируется он внутри JavaScript-тулчейна Oxc (репозиторий oxc-project/tsrs).

Что заявлено

  • Проверка типов до 8 раз быстрее TypeScript 7.0 (Go-версии компилятора) при равном числе воркеров и примерно на 70% меньше памяти. В адаптивном режиме по умолчанию tsrs ещё быстрее, но ест больше памяти. Цифры — замеры самих авторов.
  • tsrs умеет проверять код, выдавать JavaScript и файлы деклараций; есть сборка для WebAssembly — @tsrs/wasm.
  • Цель — точный порт со всеми возможностями TypeScript. Планируется слияние с проектом tsc-rs, чтобы получить поддержку LSP.

Отношения с TypeScript

Cloudflare подчёркивает: это не форк, дизайн языка остаётся за командой TypeScript, работа идёт в тесном контакте с ней. Часть находок tsrs уже вернулась в апстрим — бета TypeScript 7.1 до 2,5 раза быстрее 7.0, в том числе благодаря этим оптимизациям.

Мотивация — скорость проверок для AI-агентов, которые постоянно гоняют typecheck. Cloudflare отмечает, что современные модели позволяют выполнять крупные порты за дни, и собирается использовать агентов для отслеживания изменений апстрима.

Ограничения

Статус экспериментальный: поведение местами отличается от оригинала, например порядок вывода диагностик. Попробовать можно через npm install tsrs и npx tsrs, но в CI заменять tsc пока рано.

On Oct 20 Cloudflare announced tsrs, a Rust port of the TypeScript compiler. Started by Max Schwenk of Owner.com, it is now driven by Cloudflare and VoidZero and incubated inside the Oxc JavaScript toolchain (repo oxc-project/tsrs).

The claims

  • Type checking up to 8x faster than TypeScript 7.0 (the Go-based compiler) at equal worker counts, with about 70% less memory. The default adaptive mode is faster still but uses more memory. These are the authors’ own benchmarks.
  • tsrs can check code and emit JavaScript and declaration files; a WebAssembly build is available as @tsrs/wasm.
  • The goal is a faithful port covering every TypeScript feature. A merge with the tsc-rs project is planned to add LSP support.

Relationship with TypeScript

Cloudflare stresses that this is not a fork: language design stays with the TypeScript team, and the work happens in close collaboration with it. Some tsrs findings have already gone upstream — the TypeScript 7.1 beta is up to 2.5x faster than 7.0, partly thanks to them.

The motivation is fast checks for AI agents that run typecheck constantly. Cloudflare notes that today’s models make large ports feasible in days and plans to use agents to track upstream changes.

Limitations

It is experimental: behaviour still differs from upstream in places, such as diagnostic ordering. You can try it with npm install tsrs and npx tsrs, but it is too early to replace tsc in CI.

Источники