Skip to content

sloptor: a native roblox-ts compiler

sloptor

A native roblox-ts compiler, written in Rust. Version 2.8.3.

TypeScript in, Roblox out, at native speed.

sloptor compiles roblox-ts projects with the native TypeScript compiler and writes the same Luau as rbxtsc for most code. It supports incremental solution builds, native declarations, and compiler source maps.

mise use github:howmanyslop/sloptor
Cold build, 401-file project
74

Milliseconds, median of 40 runs. rbxtsc takes 1,631 ms on the same project.

Every tool

fig. 1 - a cold build of the 401-file benchmark project by each roblox-ts compiler. A shorter bar is a faster run.

Milliseconds · cold build · 401 files
  1. sloptor74 ms
  2. rbxtsgo125 ms
  3. rbxtsc-rs77 ms
  4. rbxts-rs109 ms
  5. rbxtsc1,631 ms
Speedup over rbxtsc
About 25×

Geometric mean of cold builds over 7 projects. It comes from running the native, parallel TypeScript compiler instead of the single-threaded JS one.

Same project

fig. 2 - one run of sloptor build. It reads the project files rbxtsc reads and writes the files rbxtsc would write.

sloptor · files it writesrbxtsc · flags it accepts
$ sloptor build -w-p, -w, --type, --rojo, --verboseout/main.luauout/layer0/module00.luauFinished 401 files in 74 ms · 401 written · 0 unchangedWatching 401 files · Ctrl+C to stop
Output differences from rbxtsc
Listed

Deliberate ones, such as switch cases after default, are in the changelog.

Node at build time
None

Only external transformer plugins start a Node sidecar.

Where next

Parity

sloptor's target is rbxtsc 3.0.0: the same project in, the same Luau out. Where it differs on purpose, the changelog says so. A difference that isn't listed is a bug.