Vercel Labs Ships scriptc, a TypeScript-to-Native Compiler with Zero Runtime
The new tool strips TypeScript down to self-contained binaries as small as 367KB, eliminating Node.js and V8 entirely for statically analyzable code.
Vercel Labs has released scriptc, a TypeScript-to-native compiler that transforms ordinary TypeScript code into small, self-contained native executables without bundling the JavaScript engine or Node.js runtime. The tool represents a shift toward "zero-runtime" TypeScript by lowering TypeScript constructs directly to a typed IR and then to C/LLVM.
Startup Times and Binary Sizes
Static binaries achieve ~2.4ms startup time (hello-world ~4ms), compared to Node.js at ~47ms. Binary sizes typically range from 170-200KB, with a tested hello-world binary measuring 367KB on arm64. Node.js single-executable applications (SEAs), which package the runtime alongside code, typically weigh 60-100MB.
Three-Tier Execution Model
scriptc uses a three-tier system to manage what can be compiled to native code. Code marked as "Compiled statically" becomes native code by default. Programs requiring npm dependencies or using `any` types can opt into "Runs dynamically" mode via the `--dynamic` flag, which embeds the quickjs-ng engine (~620KB). Code that cannot be compiled receives a "Rejected" status with a compile-time error and diagnostic.
"No changes to your code. No annotations, no dialect — the same TypeScript you run on Node, type-checked by the real TypeScript compiler and compiled to native," Vercel Labs writes in the README.
Correctness and API Support
The project enforces correctness through differential testing of 800+ corpus programs against Node.js, verifying byte-for-byte matching of stdout, stderr, and exit codes.
scriptc supports a wide range of Node.js APIs without external dependencies: fs, path, process, net, http, https, tls (via vendored mbedTLS), dgram, dns, crypto, zlib, and fetch. The fetch implementation does not require libcurl.
Why It Matters
For years, the TypeScript ecosystem has relied on transpilation to JavaScript and execution within heavy runtimes like Node.js, Deno, or Bun. While tools like `deno compile` exist, they typically package the runtime with the code rather than eliminating it.
If scriptc delivers on its promises, it could drastically reduce the operational overhead of deploying TypeScript tools. The compiler shrinks container images, eliminates `node_modules` runtime dependencies, and removes the startup latency associated with JavaScript engines. This makes TypeScript viable for high-performance CLI tools, edge workers, and tiny services where the memory and startup footprint of Node.js is prohibitive.
"scriptc's sharper move is asking how much of TypeScript can leave the JavaScript engine behind, then exposing the answer as coverage," writes pr0xy in an analysis of the tool.
The project is available at github.com/vercel-labs/scriptc with documentation at scriptc.dev.