scriptc is a TypeScript-to-native compiler that generates typed intermediate representation, readable C, textual LLVM IR, native assembly, objects, executables, and WebAssembly modules from TypeScript and JavaScript source code.
The tool addresses the problem of running TypeScript in performance-critical or resource-constrained environments by compiling it ahead-of-time to native code rather than interpreting it. It leverages the TypeScript compiler for parsing and type checking, then generates lower-level representations that can be compiled to machine code. For most targets on macOS, Linux, and Windows, scriptc bundles its own native runtime and helper tooling, requiring only a platform linker driver and SDK rather than a full C compiler. Code that cannot be statically compiled is reported as a diagnostic. For npm packages or code using the `any` type, the `--dynamic` flag embeds quickjs-ng to handle dynamic behavior at runtime.
Developers should consider scriptc if they need to ship TypeScript as standalone native executables without Node.js dependencies, or if they want to compile TypeScript to WebAssembly via WASI. The tool is experimental and works on macOS, Linux, Windows, and WebAssembly targets. It requires Node.js 24 or newer to run the compiler itself, though the compiled executables do not. Intermediate outputs like IR and C require only Node, while assembly and object emission use optional bundled platform helpers. The project explicitly supports checking static coverage to identify which parts of a program can compile statically versus which require dynamic fallback.
The project shows active development with recent commits addressing core compilation infrastructure. Work spans multiple compilation targets and output formats, indicating sustained effort across the full pipeline from parsing through code generation. The maintainers have invested in developer experience through diagnostic reporting for unsupported code patterns and explicit tooling for external object consumption via versioned JSON recipes.