HeadlinesBriefing HeadlinesBriefing.com

TypeScript Compiler Written in TypeScript

Hacker News •
×

An experimental port of the TypeScript 7.0.2 compiler, named tsc-ts, has been written entirely in TypeScript and compiled to native code using scriptc. The project, hosted under vercel-labs/tsc-ts, includes platform-specific binaries for macOS, Linux, and Windows. Installation is available via npm with the command `npm install -D tsc-ts`, followed by `npx tsc-ts -p tsconfig.json`.

The compiler mirrors the behavior of the original TypeScript compiler across all major components: scanner, parser, binder, module resolution, diagnostics, emit, and command-line interface. Extensive testing against a corpus of ~12,500 TypeScript files shows full compatibility in all areas, including declaration emit, incremental builds, and watch mode. The API server mode (`tsc-ts --api`) replicates the TypeScript 7.0.2 API over stdin/stdout, enabling compatibility with tools like scriptc.

Build processes are managed via Turborepo, with documentation available in the apps/web directory. The project requires Node.js 24+, npm, and a scriptc host with clang for linking. Native builds can be created using `npm run build:native`, and the compiler supports advanced language service features such as completions, references, and signature usage, though profiling methods are not yet supported.

Source: Hacker News · Summarized by HeadlinesBriefing