Skip to content
프로젝트

소개

LLVM/MLIR 기반의 TypeScript 네이티브 AOT(사전 컴파일) 및 JIT 컴파일러입니다. .ts 파일을 네이티브 실행 파일이나 WebAssembly로 직접 컴파일하거나, 내장 JIT로 즉시 실행할 수 있으며 Node.js나 JavaScript 런타임이 필요하지 않습니다.

프로그래밍 언어 및 런타임

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
+2
in 15 days
+3
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

TypeScript Native Compiler

Powered by LLVM|MLIR

Developed by Claude Code

Donate Test Build (Windows) Test Build (Linux)

A native ahead-of-time (AOT) and JIT compiler for TypeScript, built on LLVM/MLIR. It compiles .ts files directly to native executables, shared libraries and WebAssembly, or runs them on the fly via a built-in JIT — no Node.js or JavaScript runtime required.

Targets: Windows, Linux, Android (arm64-v8a, armeabi-v7a, x86_64), WebAssembly (wasm32, wasm64).

Contents

Quick start

Download tslang from Releases, or try it on Compiler Explorer.

File hello.ts:

function main() {
    print("Hello World!");
}

Run it with the JIT:

tslang hello.ts

Or compile it to an executable (on Linux add --relocation-model=pic):

tslang --emit=exe hello.ts
hello.exe
Hello World!

Start a new project:

tslang --new Test1

creates a Visual Studio Code project, and

tslang --cmake Test1

a CMake project for mixed C++/TypeScript (see What's new for building it).

More in Running and compiling programs: a larger example, the JIT cache, debugging JIT code with GDB, and the environment variables the linker uses.

Memory models

How heap memory is managed is selected with -mm=:

flag
-mm=gc garbage collection (Boehm) the default
-mm=rc reference counting - freed as soon as the last reference goes, no collector, no libgc does not collect reference cycles
-mm=none nothing is ever freed short-lived programs
-mm=own single ownership inferred at compile time, like Rust's borrow checker - no collector, no counting in development; ownership that cannot be proven is a compile error

See memory-models.md and the -mm=own guide. Under -mm=own tslang runs within 1.1-1.4x of idiomatic Rust on an object-heavy ray tracer and on par with it on array loops — see Performance.

Documentation

Topic Page
Running with the JIT, compiling executables, debugging JIT code docs/running.md
Android: cross-compiling and building the runtime libraries docs/android.md
WebAssembly docs/wasm.md
Memory models (gc, rc, none) docs/memory-models.md
The -mm=own single-owner model docs/own-memory-model.md
How ready -mm=own is docs/own-readiness.md
Benchmarks against Rust and C++ docs/performance.md
C and C++ bindings with tsbindgen docs/tsbindgen.md
Calling C++ classes (@cpp) docs/cpp-classes.md
JSX in .tsx files: elements as calls of your own factory docs/jsx.md
GPU kernels (@kernel, gpuLaunch) on NVIDIA, AMD and Intel GPUs docs/gpu.md
Building the compiler from source docs/building.md
What's new and roadmap docs/whats-new.md
JavaScript built-in objects library Default Library repo
How-to guides and more Wiki

Showcase: native_ts_graphics

native_ts_graphics is a set of 25 real-time 3D graphics samples — TypeScript ports of NVIDIA's Donut samples on Direct3D 12 and Vulkan, from basic_triangle to ray tracing, meshlets and work graphs — compiled to native code with tslang. .ts files are a first-class CMake language (TSLANG) linked with the C++ framework through a C interop layer, and the samples run on Windows and Android.

Community

License

This project is licensed under the MIT License — see the LICENSE file for details.

Contributing

Issues and pull requests are welcome. See the Wiki for documentation, build notes, and how-to guides.

관련 프로젝트 살펴보기

불러오는 중…