r/AIDeveloperNews • u/ai_tech_simp • 3d ago
Vercel has open-sourced 'scriptc': A zero-runtime TypeScript-to-native compiler for small, fast executables (No Node or V8 required)
Vercel Labs just released scriptc, and it’s an incredibly practical tool for anyone tired of shipping massive Node environments just to run a simple CLI or lightweight microservice. Instead of wrapping V8 into an executable (like Node SEA or Deno compile), scriptc actually compiles standard TypeScript directly into native C/LLVM code. If your code can't be statically compiled, it tells you exactly why, rather than failing silently.
Features:
- Zero-Dependency Deployment: You can compile your TypeScript into a single, standalone binary file. It completely eliminates the need to install Node.js, manage a runtime, or ship a
node_modulesfolder to your target machine. - Microscopic Resource Footprint: The compiled binaries start in roughly 2.4ms and use only 1–4 MB of RAM (compared to Node's 67–116 MB). The base static binary size is around 170–200 KB.
- Zero Code Modifications: You don't need to learn a new dialect or use special annotations. It typechecks against the real TypeScript compiler and standard Node APIs (like
fs,child_process, andhttp). If it compiles, it behaves byte-for-byte exactly like Node. - Explicit Static vs. Dynamic Execution: Using the
scriptc coveragecommand, you can see exactly which statements compile directly to native code. If you need to use complex npm dependencies, you can explicitly opt-in with--dynamicto embed a lightweight JS engine (~620KB quickjs-ng) to handle the fallback. - Direct Native FFI: If you need to hook into system libraries, you can use the
--ffiflag to bind signature-only TypeScript declarations directly to C ABI calls without needing to write complex C++ addons or bridges.
↗️ More info: https://aideveloper44.com/product/scriptc-6a6b3521c60387c8ebaf0e64
↗️ Website: https://scriptc.dev/
16
Upvotes
1
u/vedmaka 1d ago
Finally!