CHIPTS

TypeScript Native Binary

Ahead-of-time compiler that translates TypeScript into self-contained, statically-linked native executables. No runtime. No VM. Just machine code.

$ chipts hello.ts -o hello
░░░░░░░░░░░░░░░░░░░░compiling... 0%

// How It Works

Five-Stage Compilation Pipeline

.tsTypeScript source
>>
LEX
Tokenize TypeScript source into a stream of tokens using a DFA-based lexer
{}
PARSE
Build an abstract syntax tree via hand-written recursive descent parser
T:
TYPE
Two-pass type checking with compile-time type erasure — types guide codegen, add zero overhead
0x
CODEGEN
Lower typed AST to machine code via Cranelift (x86_64) or custom Thumb emitter (ARM)
->
LINK
Produce a self-contained ELF binary — statically linked, no libc, no runtime dependencies
ELF13-26 KB native binary — zero dependencies

// See It In Action

From TypeScript to Binary

hello.ts
1function add(a: number, b: number): number {
2 return a + b;
3}
4 
5const x: number = add(2, 3);
6console.log(x);
compilation output
$ chipts hello.ts -o hello
awaiting compilation...

// Compilation Targets

One Compiler. Five Targets.

  ┌───────┐
  │▓▓▓ CPU│
  │ x86_64│
  └───────┘
Linux x86_64
Cranelift-powered native code generation. Static ELF binaries with no libc dependency.
--target x86_64
  ┌───────┐
  │◇◇◇  WA│
  │  .wasm│
  └───────┘
WebAssembly
Compile to .wasm modules. Run TypeScript natively in browsers and edge runtimes.
--target wasm
  ┌───────┐
  │○○○ MCU│
  │Cortex │
  └───────┘
RP2040
Raspberry Pi Pico. Custom ARM Thumb emitter with HAL for GPIO, UART, SPI, I2C, PWM, ADC.
--target rp2040
  ┌───────┐
  │●●● MCU│
  │CortexM│
  └───────┘
RP2350
Raspberry Pi Pico 2. Extended peripherals with dual-core Cortex-M33.
--target rp2350
  ┌───────┐
  │≡≡≡ EMU│
  │  QEMU │
  └───────┘
QEMU
LM3S6965 emulation target. Test embedded code without physical hardware.
--target qemu

// By The Numbers

Raw Stats

~38K
LINES OF RUST
10 crates
13
KB BINARY SIZE
hello world
0
RUNTIME DEPS
fully static
5
TARGETS
& counting
23/23
TESTS PASSING
algorithms + OOP

// Features

What You Get

>Ahead-of-time compilationno JIT, no interpreter, no garbage collector
>Compile-time type erasureTypeScript types guide codegen, add zero overhead
>Static linkingbinaries are self-contained with no external dependencies
>DWARF debug infostep through compiled TypeScript in GDB and LLDB
>Optimization passesconstant folding, dead code elimination, function inlining
>Multi-targetx86_64, WebAssembly, RP2040, RP2350, QEMU from one codebase
>Embedded supportGPIO, UART, SPI, I2C, PWM, ADC via typed hardware abstraction
>Bump allocatordeterministic memory management with zero fragmentation
>Full language supportclasses, generics, async/await, destructuring, generators
>Built on Craneliftproduction-grade code generation framework from Wasmtime