
凭借一些额外的可用令牌,开发者兼知名YouTuber特奥·布朗使用AI代理将微软的TypeScript编译器移植到了Rust,只是为了看看是否可行。他不仅实现了一个可工作的实现,而且生成的代码还可能为AI代理提供更高效的内存环境铺平道路。布朗声称他的Rust移植版运行速度是微软今年早些时候发布的基于Go的官方TypeScript重写版(v7)的两倍,并且比之前的TypeScript版本(v6)快12.5倍——考虑到他说他甚至还没有检查过代码,这已经是相当出色的工作。
With some extra tokens to burn, developer and popular YouTuber Theo Browne used AI agents to port Microsoft's TypeScript compiler to Rust, just to see if it could be done. Not only did he produce a working implementation, but the resulting code could also pave the way for more memory-efficient environments for AI agents. Browne claims his Rust port runs twice as fast as Microsoft's official Go-based TypeScript rewrite (v7) released earlier this year and 12.5 times as fast as the previous version of TypeScript (v6) – not bad work considering he says he hasn’t even inspected the code.
布朗在视频演示中指出,TS_Rust项目即使在今年早些时候也是不切实际的。但模型正以惊人的速度发展,以前无法想象的任务如今已成为可能。基于Rust的TypeScript还打开了使用谷歌V8引擎作为运行TypeScript编写的代理工作负载的低内存替代方案的可能性——布朗认为,使用微软基于Go的TypeScript实现这一目标是不可行的。
TS_Rust is a project that would have been impractical even earlier this year, Browne noted in a video presentation. But models are developing so quickly that heretofore unimaginable tasks are now possible. The resulting Rust-based TypeScript also opens the possibility of using Google’s V8 engine as a less-memory-intensive alternative for running agentic workloads written in TypeScript, an approach that would be unfeasible using Microsoft’s Go implementation of TypeScript, Browne argued.
一项本不应可能完成的工作布朗的最初想法是通过承担一个如此庞大的项目来消耗他的多余令牌,以至于它根本不可能完成,只是为了看看最新的模型能走多远。这个代理重写涉及将TypeScript编译器、类型检查器和语言服务器进行移植,后者提供诸如错误检查和代码编辑器中的代码补全等功能。他使用OpenAI的GPT-5.6 Sol和GPT-6 Astra消耗了价值超过40万美元的API等效令牌,在这些模型在完成剩余工作时遇到困难之前,兼容性达到大约84%。
A job that shouldn’t be possible Browne’s original idea was to burn his excess tokens by tackling a project so large that it couldn’t possibly be finished, just to see how far the latest models could get. The agentic rewrite involved porting the TypeScript compiler, type checker, and language server, which provides features such as error checking and code completion in editors. He burned more than $400,000 worth of API-equivalent tokens using OpenAI's GPT-5.6 Sol and GPT-6 Astra, which reached roughly 84 percent compatibility before the models struggled to complete the remaining work.
上个月,Anthropic发布了Claude Opus 5.5,他重新审视了这个想令。令他惊讶的是,新模型产生了一个可工作的实现,通过他的Claude订阅消耗了大约价值2.4万美元的API等效令牌。
When Anthropic released Claude Opus 5.5 last month, he revisited the idea. To his surprise, the new model produced a working implementation, consuming about $24,000 worth of API-equivalent tokens through Browne's Claude subscriptions.
由此产生的实现通过了 TypeScript 一致性测试,准确率接近 100%。Browne 推测,这种意外的成功或许归功于 Claude 5.5 是一个更强大的模型。但 Claude 也足够聪明,改变了策略以抢占先机。它没有尝试直接从 JavaScript 翻译到 Rust,而是将微软的 TypeScript Go 实现移植到了 Rust,在此过程中还复制了原版中的一些 Bug。
The resulting implementation passed the TypeScript conformance tests with nearly 100 percent accuracy. Perhaps this unexpected success was due to Claude 5.5 being a more muscular model, Browne reasoned. But Claude was also clever enough to change its strategy to get a head start. Rather than attempting a direct translation from JavaScript to Rust, the model ported Microsoft's Go implementation of TypeScript to Rust, copying a few bugs from the original along the way.
Browne 只有在别人指出后才得知 Claude 做了这件事。他在视频中说:“从头将 TypeScript 从 JS 重写为 Rust 是不可行的。微软团队逐行梳理了 TypeScript 的代码,将其移植到 Go,然后开始对其进行优化,使其在 Go 中变得更好、更快。我的智能体也是对 Go 版本做同样的事情。”
Browne only learned that Claude did this after someone else pointed it out. “Writing all of TypeScript from JS to Rust would not have been viable,” he said in the video.
TS_Rust 是近期多个利用大语言模型将软件重写为 Rust 的项目之一。微软本身最近也将 Copilot 运行时重写为 Rust。该项目耗费了微软约 12 万美元的“AI 代币”。谷歌在发布其 Gemini 4 Argon 模型时,也在使用 AI 智能体将多个主要的 C/C++ 代码库(RE2、libgav1 以及 Fuchsia Zircon 内核的部分代码)移植到 Rust。
“The Microsoft team went through every line of code in TypeScript, ported it to Go, and then started refining it to make it better and faster in Go. My agents did the same thing from the Go version to Rust." TS_Rust is one of several recent projects that used LLMs to rewrite some software in Rust. Microsoft itself recently rewrote the Copilot runtime in Rust. That project cost the 'softies about $120,000 in AI coins.
除了新奇因素外,Browne 自己的 TypeScript 版本最终可能提供实际效益,因为它消除了智能体部署相对笨重的智能体工作空间(如虚拟机和 Docker 容器)的需求。他辩称,即使是微软官方的 Go 实现也无法像这样有效地完成这项工作。如果有人能将这项工作推进下去,那将是及时的。Browne 认为,随着更强大的模型即将面世,推理成本正在呈指数级暴跌,以至于支持开发者环境所需的底层算力成本很快将成为这项工作中最昂贵的部分。
Google, with the release of its Gemini 4 Argon model, is also using AI agents to port several major C/C++ codebases (RE2, libgav1, and parts of Fuchsia's Zircon kernel) to Rust. V8-powered agents Beyond the novelty factor, Browne’s own version of TypeScript may ultimately provide a practical benefit by eliminating the need for agents to deploy relatively heavy agentic workspaces such as virtual machines and Docker containers. It’s a job even Microsoft’s own official Go implementation couldn’t do as effectively, he argued. This work, should someone see it through, would be timely.
基于 Rust 的 TypeScript 编译器有望让某些智能体工作负载直接在 Google 的 V8 引擎中运行,而不必再依赖完整的容器或虚拟机。例如,Cloudflare 已经利用 Google V8 JavaScript 运行时隔离多个用户环境,从而为每个客户环境节省数百兆字节的内存。TypeScript 本身去除类型注解后即可在 V8 中干净运行,但微软基于 Go 的 TypeScript 编译器并不适配,因为 Go 的垃圾回收器必须通过 WebAssembly 捆绑进运行时 —— 这绝非易事。
Browne argued that with more powerful models on the horizon, inference costs are plummeting exponentially, so much so that the underlying compute costs needed to support developer environments will soon be the most expensive part of the job. With a Rust-based TypeScript compiler, some agentic workloads could potentially run within Google's V8 engine, instead of requiring a full container or VM. Cloudflare, for instance, already isolates multiple user environments using the Google V8 JavaScript runtime, thereby saving hundreds of megabytes per customer environment.
而 Rust 无需垃圾回收器,因此能更高效地编译为 WebAssembly。理论上,轻量级的智能体环境可结合 TS_Rust 与内存级 Shell 环境(如 Vercel 的 Just Bash)在 V8 内运行,有望比在虚拟机中运行同类工作负载更低成本。对于 Browne 而言,他对 AI 与软件工程依然看好。“这类‘豪赌式’项目本不该具备可行性。照理说它连测试都过不去,更别说真能作为 TypeScript 的直接替代品运行了,”他说道。®
TypeScript itself, stripped of its type annotations, runs cleanly within V8, but Microsoft’s Go-based TypeScript compiler is not a good fit because Go's garbage collector must be bundled into the runtime using WebAssembly – no easy task. But Rust doesn’t need a garbage collector, so it compiles more efficiently with WebAssembly. A lightweight agentic environment could, in theory, run within V8 using TS_Rust and an in-memory shell environment such as Vercel's Just Bash, potentially reducing costs compared with running the same workloads in a VM. As for Browne, he remains bullish on AI and software engineering. “These types of YOLO projects should not be viable at all. Like [it] shouldn't even be able to pass the tests, much less actually work as a drop-in replacement for TypeScript,” he said. ®