| Scriptc by Vercel: TypeScript-to-Native compiler, no JavaScript engine in binary(github.com) | |
| 276 points by maxloh 1 day ago | 153 comments | |
tl;dr: Scriptc is a Vercel tool that compiles standard TypeScript into small native binaries (170KB–3MB) with ~2ms startup, no bundled JS engine by default, using clang and a custom C runtime. It uses the real TypeScript compiler for type-checking and covers most of the language plus Node APIs (fs, http, tls, fetch, etc.); code that can't be statically compiled is either rejected with diagnostics or run via an embedded QuickJS engine in an opt-in `--dynamic` mode. Correctness is enforced via differential testing against Node (byte-for-byte stdout/stderr matching) and AddressSanitizer runs. | |
HN Discussion:
| |