TypeScript’s type system is Turing Complete. The type system is extremely advanced — you can model algebraic data types (unions, intersections, tuples), conditional types, mapped types, and more. It is a structural type system. In TS 4.1, template literal types were introduced, making it easy to do string manipulation within the type system so that you can concatenate, compare, and pattern-match the types. Many of the examples below (like TS-SQL) use template literal types.
Some interesting applications built in entirely in the TypeScript type system:
- SQL database implemented purely in TypeScript type annotations
- Tokenizer/parser/interpreter on type-level
- Compile-time spell checker using TypeScript’s type checker
- Binary Arithmetic in TypeScript Type System
- Chess implemented in the Rust and TypeScript type systems
- Lambda calculus in TypeScript’s Type System
And some other accidentally Turing Complete systems.