Ein Blog

Sagte ich, jemand hat TypeScript nach Rust portiert? Cloudflare will da auch mit machen.

Der Unterschied: Sie arbeiten mit VoidZero zusammen und bauen es in OXC ein. Das wird dann auf lange Sicht wohl Teil von VitePlus. Sie betonen aber, dass sie TS nicht forken wollen. Das wird dann wohl einfach eine sehr harte Variante eines “Hard Forks” sein. Warum machen sie es noch? Rust läuft besser in WASM, weil da kein GC hinter hängt. Wahrscheinlich haben sie dann auch besseres FFI, wenn die restliche Toolchain auch bereits in Rust gebaut ist.

Sie machen es aber nicht komplett selbst. Sie nehmen den Code von Theo als basis:

First, we are working with Theo Browne to merge tsc-rs and tsrs into a single package that supports all of TypeScript’s features including Language Server Protocol (LSP) and content mappers.

Daniel Rosenwasser (aus dem TS-Team) hat da auch schon drauf geantwortet:

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.