What is TypeScript written in?

The TypeScript compiler (tsc) is written in TypeScript itself, making it self-hosting. It compiles TypeScript to JavaScript, so the compiled tsc runs on any JavaScript engine. The TypeScript compiler and language services are fully self-hosted.

Quick Facts

Short answer
tsc is written in TypeScript
Created by
Anders Hejlsberg, Microsoft, 2012
Output
Transpiles to JavaScript
Runtime
None of its own, runs on JS engines

Details

TypeScript is self-hosting: the tsc compiler is written in TypeScript. This means TypeScript's compiler is compiled by itself, a previous version of tsc compiles the next version.

Since TypeScript compiles to JavaScript, the compiled tsc binary runs on Node.js or any JavaScript engine. This makes TypeScript's self-hosting unique: it's a compiled language whose compiler runs as interpreted JavaScript.

Explore in the Graph

See implementation and influence relationships interactively.

Open Interactive Graph →

Related Pages