AI 编程 4.0 · 优秀 2026-10-20 · 文章

Introducing tsrs: a Port of TypeScript to Rust

Cloudflare 与 VoidZero 同 Owner.com 的 Max Schwenk 合作把 TypeScript 编译器移植到 Rust(tsrs),孵化在 Oxc 工具链里,强调不 fork 语言设计与方向仍归 TypeScript 团队,并将与 Theo Browne 的 tsc-rs 合并以补齐全类型检查特性与 LSP基准:相同 type check worker 数下比 TypeScript 7.0 快最多 8 倍内存省约 70%...

打开原文回到归档

Introducing tsrs: a Port of TypeScript to Rust

  • ID: 5e241867
  • 原文链接: https://blog.cloudflare.com/typescript-rust-port/
  • 作者 / 日期: Cloudflare Blog | 2026-10-20
  • 分类: coding
  • 来源类型: article
  • 标签: typescript, rust, toolchain, wasm, agent-maintenance
  • 质量评分: 4/5
  • 抓取时间: 2026-10-21T15:51:49.496237+00:00

中文导读

Cloudflare 与 VoidZero 同 Owner.com 的 Max Schwenk 合作把 TypeScript 编译器移植到 Rust(tsrs),孵化在 Oxc 工具链里,强调不 fork 语言、设计与方向仍归 TypeScript 团队,并将与 Theo Browne 的 tsc-rs 合并以补齐全类型检查特性与 LSP。基准:相同 type check worker 数下比 TypeScript 7.0 快最多 8 倍、内存省约 70%;文中同时给出保守参照——TypeScript 7.1 beta 本身已比 7.0 快最多 2.5 倍(部分优化从 tsrs 上游回灌),基准配置与 TypeScript 团队对齐。选 Rust 落在 Wasm:Go 编译到 Wasm 要把 GC 一起编进去,Rust 的内存模型让 Wasm guest/host 直接内存交互,配合 Workers 的 wasm-bindgen Emscripten target,完整类型检查工具链可进 Worker、浏览器与嵌入式设备;npm install tsrs 已可试。维护照搬 Vinext 的 agent 流水线:每天 agent 拉上游 diff 开 tracking issue,每晚重跑兼容矩阵,发现行为差异由 agent 定位跨仓库改动、构造复现、移植测试并提修复;性能优化回馈微软的 TypeScript Go 代码库。「为什么是现在」的观察:frontier 模型几天内就能独立完成大规模移植,于是同时出现 slopfork、忠实移植与彻底重新架构三个流派——重写成本塌了之后,真正的约束变成能不能持续跟住上游。

为什么值得关注

工具链维护模式的变化比性能数字更重要:当大规模移植可以被 agent 流水线持续跟住上游,重写项目的成败约束从「写出来」变成「跟得住」。

关键信息

  • tsrs + tsc-rs 合并;Oxc 孵化;不 fork 语言
  • vs TS 7.0:最多快 8 倍、内存 -70%;保守参照:7.1 beta 已快 2.5 倍
  • 动机在 Wasm:无 GC、guest/host 直接内存交互、Workers 的 Emscripten target
  • 维护:每天 agent 审上游 diff 开 issue、每晚兼容矩阵、agent 自提修复

English Summary

Cloudflare and VoidZero, working with Max Schwenk (Owner.com), are porting the TypeScript compiler to Rust as tsrs, incubated in the Oxc toolchain — explicitly not a fork, with plans to merge Theo Browne's tsc-rs for full type-checking and LSP support. Benchmarks: up to 8x faster than TypeScript 7.0 with ~70% less memory at equal type-check workers, with the honest caveat that TS 7.1 beta is already up to 2.5x faster than 7.0 (partly from tsrs backports), measured on aligned configs. Rust is chosen for Wasm: no GC payload, direct guest/host memory interaction, and Workers' wasm-bindgen Emscripten target put a full type-checking toolchain in Workers, browsers and embedded devices (npm install tsrs). Maintenance copies the Vinext agent pipeline: daily upstream-diff triage issues, nightly compatibility matrix reruns, and agents that locate cross-repo changes, build repros and propose fixes.

Obsidian Notes

  • Vault 摘要源:ClawFeed24小时高价值一览 2026-10-21 第 4 条 + DevRadar 2026-10-21 P2;页面标题经 curl og:title 核对。
  • 本页由 daily-intake-evening 任务于 2026-10-21T15:51:49.496237+00:00 生成,摘要锚定上述 vault 摘要源与已核对元数据,未添加来源之外的事实。