GitHunt
LI

lidangzzz/TypeScript-C-Implementation-by-OnlySpecs

An unofficial implementation of TypeScript compiler implemented in C++ by OnlySpecs

TypeScript Compiler v6.0 - C++ Implementation

A C++ reimplementation of the TypeScript compiler, fully compatible with TypeScript 6.0.

Requirements

  • C++20 compiler (GCC 11+, Clang 14+, or MSVC 2022+)
  • CMake 3.20+
  • Node.js 14.17+ (for testing only)

Building

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j$(nproc)

Installation

cmake --install . --prefix /usr/local

Usage

# Compile files
./tsc file.ts

# With options
./tsc --target ES2020 --module ESNext --outDir ./dist file.ts

# Watch mode
./tsc --watch

# Language server
./tsserver

Project Structure

├── include/tsc/      # Headers (compiler, services, server, core)
├── src/              # Implementation
├── tests/            # Unit, integration, and system tests
└── CMakeLists.txt    # Build configuration

Testing

./test_cpp_compiler.sh

License

Apache-2.0

Languages

Makefile89.8%C++5.1%JavaScript2.3%TypeScript2.2%CMake0.5%Shell0.0%

Contributors

Created March 12, 2026
Updated March 14, 2026
lidangzzz/TypeScript-C-Implementation-by-OnlySpecs | GitHunt