TypeScript Compiler

What is TypeScript?

TypeScript is a language with optional static typing that compiles to JavaScript. It’s an typed strict superset of JavaScript; valid JavaScript is valid TypeScript, which allows you to gradually add types to your existing JavaScript codebase.

Static typing helps enables the compiler to catch many more bugs at compile time than in a dynamic language like plain JavaScript, where almost all errors happen at runtime. Static types also provides more information to tools like IDEs, allowing for more powerful automated refactorings. Static types combined with the other tools TypeScript gives you, like classes and a module system, make it well suited for large codebases.

TypeScript’s type system has basic type-inference and is similar to the one found in Java or C. If you’re interested in an ML-like language that compiles to JavaScript, I recommend you check out Purescript.