TypeScript

Compile TypeScript to Native Code and Transform Your App Performance

Vercel Labs' scriptc takes TypeScript out of the Node.js runtime and compiles it straight to native code. That means faster startup and a lighter memory footprint, though execution speed still lags behind Node. It's…

3 min readInfoQ
Compile TypeScript to Native Code and Transform Your App Performance

Vercel Labs has introduced scriptc, an experimental compiler that turns TypeScript into small native executables, bypassing Node, V8, and any JavaScript engine entirely. It leans on the TypeScript compiler for type checking and can emit C or WebAssembly. Early benchmarks point to faster startup times and lower memory usage than Node, though execution speeds lag behind. That tradeoff is worth pausing over, because it reframes what we think we are optimizing for when we reach for a runtime.

If you have been following the push toward more efficient compute models, this move should resonate. We have seen similar architectural ambition elsewhere, such as in the Build a Decentralized Web: Exploring Spritely’s Innovative Architecture, where the goal is to rethink core infrastructure from first principles rather than patch over legacy constraints. scriptc is doing something comparable for the TypeScript ecosystem, questioning the assumption that a JavaScript engine must be the default execution layer. It is not a rejection of the language or its community, but a bet that the type system can carry more weight than the runtime ever did. That is a progressive stance, and it aligns with the kind of future-focused thinking that pushes the industry forward without dismissing what came before.

For developers, the practical takeaway is not that scriptc will replace Node tomorrow. It will not, and it probably should not yet. The slower execution speeds are a real barrier for compute-heavy workloads. But for serverless functions, CLI tools, or edge workers where cold starts dominate the user experience, faster startup and lower memory footprint can outweigh raw CPU speed. That is where this experiment gets interesting. If you have ever watched a Lambda function spin up and felt the delay, you already know why a compiler that produces a lean native binary is compelling. It is not about abandoning the ecosystem; it is about giving you more options for the right job. We would tell any reader who asked that this is a tool to watch, not a migration target. Try it on a small service, measure the difference, and decide whether the tradeoff suits your constraints.

The open question is whether scriptc can close the execution speed gap without losing its lightweight edge. That will determine if it remains a clever experiment or becomes a serious alternative. We would also point to the Orchestrate AI Agents: Google Open-Sources AX for Enhanced Efficiency as a parallel example of how infrastructure is being rebuilt to handle specialized workloads more directly. Both efforts suggest a broader shift toward purpose-built tools rather than one-size-fits-all runtimes. The specific detail to watch is how scriptc handles the type-only imports and dynamic code patterns that are common in real-world TypeScript projects. If it can handle those gracefully, the performance profile becomes much harder to ignore.

From InfoQ

Vercel Labs has introduced scriptc, an experimental compiler that converts TypeScript into small native executables without relying on Node, V8, or a JavaScript engine. It uses the TypeScript compiler for type checking and can output C or WebAssembly code. Initial benchmarks show faster startup times and lower memory usage than Node, though it experiences slower execution speeds.

Read the original at InfoQ