r/typescript • • 3d ago

vercel-labs/scriptc: TypeScript-to-Native Compiler

https://github.com/vercel-labs/scriptc

Vercel 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.

65 Upvotes

17 comments sorted by

33

u/boneskull 3d ago • Bravo

lol @ the limitations doc

21

u/Pelopida92 3d ago

jeez, I just looked at it. It is CLEARLY 100% AI generated, its a gigantic blob of slop, nobody even cared about reading it once lol

8

u/boneskull 3d ago

tbh I don’t know why people keep trying to do this. given JS’ fuzziness and mires of esoteric behavior, I can’t see how any TS-to-native compiler could cover the full abilities of the language (though TS certainly can mitigate much of the loose-typing, but not all).

I’m not saying it’s impossible, but I’m doubtful that the juice (effort, tokens, maintenance) is worth the squeeze.

1

u/bzsearch 2d ago

man... that section is such a turn off.

3

u/azangru 2d ago

Reads like an end-user license agreement 😄

12

u/eracodes 3d ago

scriptc uses the real TypeScript compiler for parsing and type checking

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

1

u/Ill_Bill6122 1d ago

If you want TS to run in wasm, you need a frontend to compile it and then you can use wasm as a backend in your compiler tool chain. We don't have TS -> native. The project tried to do this, but still ended up having to embed an interpreter.

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

3

u/Wonderful-Habit-139 2d ago

6 months? Just write it properly without AI at this point and you're gonna have a much better codebase in 6 months.

3

u/pie-oh 3d ago edited 2d ago

Maybe learn who the Luddites were before using them in arguments?

They weren't anti-progress. They were against rich people redistributing wealth to themselves.

People aren't complaining because they're "stuck in the past," they're complaining that it's a bit nonsensical and low effort.

edit: Tests passing isn't always a good metric either. Tests written after implementation can test only the implementation. And tests that fail can be deleted. They're one of many factors in a quality codebase.