TypeScript 重写Go版本提速10倍
推荐指数 71.0 NO. 013 · 2026.07.09
发布2026/07/08Score226Comments71
为什么值得看
微软正式发布 TypeScript 7,将编译器用 Go 语言重写,实现原生性能,速度提升约10倍。对大型代码库和 CI/CD 流水线影响最直接,构建时间可能从分钟级降到秒级。
编辑判断
TypeScript 团队选择 Go 而非 Rust 值得玩味。Go 的 GC 和快速编译特性更适合需要频繁迭代编译器逻辑的场景,而 Rust 的内存安全优势在这里被刻意让渡了。这意味着微软评估后认为开发速度和团队生产力比极致运行时性能更重要。
对 AI 工程团队的一个直接信号是:如果你的 AI 应用用 TypeScript 写(比如 Vercel AI SDK、LangChain.js 项目),本地开发体验和部署构建时间会有质变。但注意,这是编译器重写,不是类型系统变更——迁移成本应该极低,不过建议先在非核心项目验证 Go 版编译器的边缘 case 兼容性,历史项目里那些复杂的条件类型和模板字符串类型可能是首批踩雷点。
社区反馈
正面 62 条评论
核心争论:Go 重写已足够快,Rust 是否值得为额外性能和生态整合再重写
相关内容
TypeScript 7.0 RC 发布:编译器用Go 重写,类型检查提速10 倍 微软发布TypeScript 7.0 RC,编译器完整用Go重写,类型检查比6.0快约10倍。 TypeScript 编译器Go 重写版提速10 倍:微软团队深度揭秘 团队通过自动转译工具快速获得可用版本,Go版已通过10万个测试用例。 Typescript用Go重写!效率提升10倍+ Anders Hejlsberg领衔团队用Go重构,实现编译速度提升10倍、内存占用减少50%。 Rust粉丝破大防,TypeScript之父选Go语言重写编译器 微软选Go而非Rust引发讨论,承诺10倍性能提升及AI驱动新功能。
the real story here is an incredible team that managed to simultaneously keep two separate codebases alive for the most advanced type system known to mankind (yeahhh yeahh Hindley-Milner eat your heart out). huge congrats to the team! looking forward to the Rust rewrite ;)
Most complex, perhaps, but not "most advanced". I don't think there's necessarily a meaningful "correct" choice for that title, but surely one of the proof assistant languages would be a more likely candidate? (I don't say this to be disparaging of TypeScript's type system, by any means — it's very
good points, let's get negated types and higher kinded types in there then you've got yourself a deal. maybe regex thrown in too for flavor