RTS: A Rust-Based TypeScript-to-Native Compiler and Runtime
RTS compiles TypeScript directly to native code via Cranelift, skipping V8 entirely. With JIT/AOT modes, a custom Rust standard library and its own HTML/CSS engine, it targets true native performance.
RTS is a compiler and runtime that turns TypeScript directly into native machine code via Cranelift, working from the SWC AST without relying on V8 or any other JS engine. It offers both a JIT mode (compiling to executable memory on the fly) and an AOT mode (producing standalone ~3 KB binaries), backed by a from-scratch Rust standard library spanning 40+ namespaces (io, fs, crypto, thread, http_server, and more) with zero dependency on OpenSSL, libuv, or similar external runtimes.
The engine was rebuilt around a new value model using PolyValue NaN-boxing, shape-based object representation, and inline caches. The team is currently running a correctness-first campaign: 456 of 609 standalone TS test fixtures (77%) now match Bun and Node exactly. Performance numbers are presented candidly — for integer-heavy workloads like Monte Carlo pi calculations, RTS's AOT mode dramatically outpaces Bun, but a roughly 70 ms AOT startup cost currently dominates short-lived tasks. The 5.4x speedup achieved by the previous engine remains the target but hasn't been fully re-tuned into the new one yet.
A notable component is crates/rts-dom, a pure-Rust HTML/CSS rendering engine that reimplements the canonical browser pipeline (DOM, CSS cascade, layout, paint) from scratch. It supports flexbox, CSS animations, unit calculations, and pixel-perfect layout validated element-by-element against real Chrome measurements. On the language side, classes, generators/async functions, Proxy, TypedArrays, and much of the Web/Node API surface already work, while decorators and a full generics/type-checker are still missing.
For engineers, RTS is a concrete, measurable attempt at running native TypeScript without a JS engine underneath. Its Cranelift-based codegen, boxing-free typed ABI, and self-contained runtime present an alternative execution model for CLI tools and performance-sensitive server workloads — though the project is still maturing toward full JS compatibility.