r/typescript • u/nilukush • 3d ago
vercel-labs/scriptc: TypeScript-to-Native Compiler
https://github.com/vercel-labs/scriptcVercel Labs has released scriptc, an experimental Apache 2.0 licensed compiler that turns ordinary TypeScript into small native executables with no Node, V8 and no JavaScript engine in the binary.
The repository was created on 22 July 2026 and has since gathered around 4.9k stars. scriptc uses the real TypeScript compiler for parsing and type checking, lowers programs to a typed IR, then emits readable C, LLVM IR, assembly, objects, native executables or WebAssembly via WASI Preview 1.
Every construct lands in one of three tiers: compiled statically by default, run dynamically inside an embedded quickjs-ng engine of roughly 620KB when --dynamic is passed for npm packages and any typed code, or rejected at compile time with an SC code and a rewrite hint.
A benchmark of scriptc 0.0.16 against Bun 1.3.12 and Node 24.18.0 recorded median CLI startup of 1.78ms versus 21.29ms for Bun and 61.78ms for Node, with idle memory of 1.9MiB for a framework free node:http server. The same tests found Hono required --dynamic, pushing 62% of the server into QuickJS and cutting throughput to 18.4k requests per second against Bun's 70.5k.
33
u/boneskull 3d ago •
lol @ the limitations doc
12
u/eracodes 3d ago
yeah i would hope so????
5
u/nudelkopp 3d ago
What’s the benefits of doing this rather than running a wasm binary through something like wasmtime? Less overhead yeah, but this does not feel very reliable
4
u/g0ld3nrati0 3d ago
use rust/odin/zig
3
u/satansprinter 3d ago
In theory a great idea in practice this is awful. If they used a transpiler to go however most of the things that makes typescript typescript would be possible to do but this is just ai slop
2
u/Kadabrium 3d ago
Custom gc?
1
u/PuzzleheadedDust3218 13h ago
https://www.perryts.com/ does exactly that bur thousands of times better
-1
u/Opposite_Sector2145 3d ago
If you want npm package support or need to use dynamic TypeScript features, you have to pass the --dynamic flag, which embeds quickjs-ng. But that balloons the binary and slows things down, so avoid it unless absolutely needed.
-6
u/krazyjakee 3d ago
If tests pass, performance is better and survives 6 months of maintenance and security, I want to see all the luddite commenters back here for an apology.
/Remindme 6 months