TypeScript-to-native compiler experiment

TS-Native

TS-Native is a compiler experiment for translating a TypeScript-flavored language into native binaries. The interesting part is not only code generation, but the design pressure created when familiar syntax has to survive parsing, type analysis, IR design, and machine-level output.

TS-Native compiler architecture visual

The problem it tackles

It is easy to talk about compilers in abstract terms and much harder to define a language rigorously enough that every stage of the pipeline has a reason to exist. TS-Native is valuable because it forces questions about syntax, semantics, type systems, and native output to live in one coherent system.

Architecture

The key system decisions

01

Parser crate

Turns TS-like syntax into an internal representation that is strict enough to support later compiler stages.

02

Type analysis layer

Reasons about language semantics beyond surface syntax so the compiler can enforce meaning instead of just shape.

03

TS-Native IR

Acts as the bridge between source-level intent and backend code generation decisions.

04

LLVM-backed output

Lowers the IR into native binaries through a backend that exposes real systems-level constraints.

What matters

  • Used the project as a forcing function to learn compiler construction beyond tutorial depth.
  • Separated the workspace into parser, type system, IR, codegen, and CLI concerns to keep the architecture teachable.
  • Tightening the formal language specification so the compiler is defined by rules instead of implementation accidents.
RustLLVMParser designType systemsCLI

Media

Screenshots and demos

TS-Native pipeline diagram

TS-Native pipeline diagram

TS-Native CLI preview

TS-Native CLI preview