TypeScript 编译器用 Go 重写提速 10 倍
推荐指数 70.0 NO. 013 · 2026.06.19
发布2026/06/18Score52Comments5
为什么值得看
TypeScript 7.0 RC 将编译器从 TypeScript 自举迁移至 Go 实现,借助原生代码与共享内存并行将性能提升约 10 倍。对大型代码库团队和 CI/CD 流水线而言,构建时间瓶颈可能被根本性缓解。
编辑判断
这次迁移的深层意义在于验证了"自举语言工具链用系统语言重写"的可行性路径。TypeScript 团队选择逐行移植而非重写,降低了引入类型系统 bug 的风险,但也意味着 Go 版本短期内不会新增语言特性。
对 Vite、esbuild、swc 这些已经用 Rust/Go 做 TS 转译的工具链来说,官方编译器提速会压缩它们的差异化空间,尤其是类型检查这一 swc 尚未攻克的环节。
如果你维护大型 monorepo,建议现在就用 RC 跑一遍类型检查耗时 benchmark,但别急着上生产——类型兼容性 corner case 的迁移 bug 通常要在真实代码库里才能暴露。
社区反馈
正面 5 条评论
核心争论:社区普遍赞赏性能提升,关注衍生工具(文件监控)能否独立复用
This sounds really great. As a Go developer I'm also really looking forward to their Go port of the filesystem watcher package — I agree that the existing packages don't fully allow to do a reliable recursive directory watch and it would be great to have something where you don't rely on C dependenc
> As a Go developer I'm also really looking forward to their Go port of the filesystem watcher package You plan to contribute to the TypeScript project?
No, in fact I do not use TS at all :). However they did mention this in the article, and hopefully that also means they'll make the package accessible to others too: > The watcher is a self-contained package that has allowed us to keep a clean separation of concerns between what we care to watch and