Vercel's scriptc turns TypeScript into tiny, engine-free native binaries

Vercel's scriptc turns TypeScript into tiny, engine-free native binaries

You can now compile ordinary TypeScript into a tiny, self-contained binary without bundling a massive JavaScript engine.

Vercel Labs open-sourced scriptc, a compiler that translates TypeScript directly into native machine code. Instead of bundling Node.js or the heavy V8 engine, it analyzes your code to determine what can run statically. This produces self-contained binaries as small as 170KB that start up in about two milliseconds.

Why it matters: Running TypeScript usually requires a large runtime that drags down startup times and hogs memory. With scriptc, a typical program uses just 1 to 4MB of RAM, compared to over 60MB for Node. It makes TypeScript a viable choice for lightweight command-line utilities and fast-booting microservices.

If your code uses dynamic features or third-party npm packages, passing the --dynamic flag embeds a tiny, 620KB JavaScript engine to handle them. The tool currently requires Clang, supports macOS arm64 as its primary platform, and cross-compiles to Linux and Windows.

Your favorite web language just got a lot closer to the metal.

Sources