Cloudflare and VoidZero Port TypeScript to Rust, Claiming 8x Speed and 70% Less Memory

Tsrs: A Port of TypeScript to Rust

Cloudflare and VoidZero Port TypeScript to Rust, Claiming 8x Speed and 70% Less Memory

Cloudflare and VoidZero are collaborating with Max Schwenk of Owner.com on tsrs, a Rust port of the TypeScript compiler incubated within the Oxc toolchain. Early benchmarks show up to 8x faster performance and roughly 70% less memory than TypeScript 7.0. The project is not a fork; the TypeScript team retains full control of language design. A key advantage is WebAssembly support, enabling development environments to run in browsers and on Cloudflare Workers. An experimental npm release is available.

When you compile a Go program to Wasm, you have to compile Go’s garbage collector along with it. But Rust’s memory management model enables straightforward memory interactions between a WebAssembly guest and host.
  1. DanRosenwasser

    Hey there, TypeScript team member here. The tsrs project has been extremely interesting to see come together. We've been working with the maintainers to better understand how tsrs is fast and what sorts of optimizations it uses are safe. We even did our own Rust vibe port and what we currently suspect is that a lot of the speed does not just come down to language choice, and some of what is going to make TS 7.1 faster and leaner (see the charts in the blog post) actually comes from optimizations discovered in tsrs.

    We think the wasm and oxlint integration makes a lot of sense for Cloudflare's needs, so this investment makes sense. At the same time, we'll be working hard and collaborating to make the official TypeScript toolset faster and even more efficient.

    Congrats to the tsrs team on making this official. We're excited and we look forward to continuing on collaboration!

  2. ComputerGuru

    Apparently only supported under darwin and linux for arm64 and x64? At least via npm.

  3. afdbcreid

    It appears they're using a unique memory model (https://github.com/oxc-project/tsrs/blob/main/docs/PORTING.m...) to overcome the challenge that prevented the TypeScript team from choosing Rust to begin with: Rust has no GC and porting from a GC language to it often requires restructure of data.

    Essentially, they fake a GC via never-freed arenas for long-living objects. It's interesting that Rust can do that (hopefully soundly)!

  4. sheepscreek

    Ah took me a while to understand the reason behind this.

    It wasn’t “let’s build a faster Rust based Typescript compiler” at all. That was a nice side-effect.

    They needed a Typescript compiler that can run on their WASM only sandbox. So the only existing option was to export tsc Go to WASM, but that comes with the full Go runtime.

    And to avoid that cost, they experimented with a Rust compiler and turns out it’s even faster than the reference tsc/Go implementation.

  5. egonschiele

    It's exciting to see the speed gains. I use TypeScript every day on a large codebase, and it is too slow to run locally.

    I don't love this change though:

    > However, frontier AI models can now do large-scale ports almost independently in a matter of days

    > I wrote zero code. Not "barely any". Zero

    So we are going to move from a carefully handwritten port to an entirely AI-generated port. I know this is the way the industry is headed, I use coding agents a ton. But I still review their output because they often don't make sound architectural decisions. Maybe this is a sign that my way of working is going away. I'm not sure how to justify that kind of time spent when someone can do the same thing in a matter of days with barely any effort.

    I am working on my own language now, I've spent most of this year on it. The idea that someone could just replace it in a matter of days is wild. Wonder how the TS team at Microsoft feels about this.

  6. sashank_1509

    I guess it will be soon that typescript won’t matter anymore since agents will be writing code is Rust compiled to WASM or similar for everything. typescript added human readability or JavaScript, if no human is coding, I don’t see the point of wasting tokens on this.

  7. hollowturtle

    All of this just for enabling the WASM use case? Why not keep supporting Deno then that is written in Rust? To me it just sounds like a technical ai journey and a blow to the go port

  8. AbuAssar

    According to voidzero, this port is up to 8x faster than TS 7.0 & ~70% less memory.

    Microsoft should seriously consider porting typescript to rust at this point

More from this day

2026-10-20