Introduction
Sloptor is a native TypeScript-to-Luau compiler for Roblox, written in Rust. It ports the roblox-ts emit layer onto the native TypeScript compiler.
Sloptor aims to match rbxtsc. It reads the same project files and @rbxts/* packages, takes the same flags behind a build subcommand, and writes the same Luau for most code, at about 25× the speed on the native TypeScript compiler (benchmarks). It isn't a drop-in swap for every project: see Migrate from rbxtsc for what can break. Where the fork changed behavior, the verified @isentinel/roblox-ts@4.0.11 archive in roblox-ts.zip is the authority.
roblox-ts is a brilliant compiler with one structural problem. It runs on the JavaScript TypeScript compiler API. Every build boots Node, then parses, binds, and typechecks your entire project in single-threaded JS. Watch-mode rebuilds, cold builds, and startup are all slow, and they get slower as your game grows.
A plain syntax transpiler can't fix that, because the roblox-ts emit is type-directed:
for...ofcompiles differently for anArray, aMap, and a string.+becomes+or..depending on the operand types.- Truthiness guards depend on whether a type can be
0or"". - The entire macro system resolves through the type checker.
Without types, the Luau is wrong.
rbxtsgo, a Go rewrite on the same compiler, makes the same bet. Why sloptor covers how the two compare and where each is the better pick.
The breakthrough is typescript-go, Microsoft's official native port of the full TypeScript compiler, available as TypeScript 7. It's about 10x faster, and it offers parallel checking and configurable concurrency controls. It's the only native build of the real checker. Sloptor ports the roblox-ts emit layer to Rust on top of tsrs, a Rust port of that compiler.
How sloptor checks compatibility
Section titled “How sloptor checks compatibility”The project checks compatibility on purpose:
- Differential testing: tests byte-compare compiler output for unchanged behavior against
rbxtsc3.0.0 output. They compare fork-changed surfaces against the verified@isentinel/roblox-ts@4.0.11archive. That covers solution builds, watch, source maps, copy-file gating, resolver caches, and the fork's optimized emit paths. - Behavioral conformance: sloptor compiles the vendored roblox-ts runtime suite and runs it under Lune. The in-repo corpus and test runners cover both the upstream reference and the verified fork fixtures. They live in
testdata/conformanceandcrates/rotor_compile/tests/conformance.rs. Goldens that diverge for the fork are fork-authoritative and don't pose as upstream matches. - Faithful porting: the reference sources live in the repo under
reference/, and reviewers check ports line by line against them. That includes quirks like ECMAScriptNumber::toStringformatting and temp-identifier collision naming. - Same runtime:
RuntimeLib.luaandPromise.luamatch the targeted roblox-ts compiler runtime.
Your existing project is the compatibility target, unchanged. That means tsconfig.json, default.project.json, node_modules/@rbxts/*, and external transformer plugins. Native Flamework is opt-in through [flamework] in rotor.toml. Without an effective native configuration, the legacy tsconfig plugin runs through the Node sidecar. The compatibility oracle depends on the feature. Use the fork archive for the changed behavior and upstream parity elsewhere.
What works today
Section titled “What works today”Sloptor compiles multi-file TypeScript projects with upstream or fork-authoritative parity across the language:
- imports with Rojo-aware require chains
- JSX with
@rbxts/react - classes and decorators
- async functions and generators
- try/catch
- enums and namespaces
- spread, functions, closures, and destructuring
- the full macro tables, such as
Array.map,string.format, andMap.get - optional chaining
- Map, Set, string, and generator iteration
- switch and
new
It also natively typechecks and watches real rbxts projects.
Native Flamework is an opt-in compiler pipeline. It follows the v1.3.2 transformer reference through native parity tests and runs in the native pipeline.
One intended divergence affects standalone Flamework.addPaths(path) or Flamework.addPathsGlob(glob) calls. Each call becomes one immediate TS.import per matching module, sorted by path, at the call site. This includes calls inside functions and blocks. Bundlers can follow these imports but not the runtime requires of Instances that Flamework makes. Sloptor skips these files:
- scripts, such as
.server.tsand.client.ts - declaration files
- the calling file
- TypeScript files that tsconfig excludes
Calls that match a hand-written Lua module keep the runtime behavior. Adding or deleting modules under plain addPaths directories changes the incremental input, without changing flamework.build or globs.json.
The Node sidecar is still there for external tsconfig transformer plugins. That includes rbxts-transformer-flamework when native Flamework is off.
Sloptor gives anything not yet ported a clear "not yet supported" diagnostic and tries not to emit wrong output without a warning. Type errors are the exception: sloptor can still transform a type-broken file, and the output can be wrong. For code the fork didn't change, compiled output matches rbxtsc 3.0.0, apart from the deliberate fixes listed in the changelog. For fork-changed code, output follows the verified fork behavior.
Production readiness
Section titled “Production readiness”Sloptor is ready for production rbxts projects that want native-speed check, check -w, build, and build -w. That includes declaration emit, incremental rebuild selection, and native Flamework. Flamework-only builds don't need Node.js.
External transformer-plugin support uses the bundled Node sidecar. Builds that resolve external plugins need Node.js on PATH so sloptor can launch that sidecar.
Notes and current caveats are on the roadmap:
build -wreuses the manifest-backed changed-file selection of sloptor and runs a debounced, pruned polling watcher. It never walksnode_modules, dot-directories, or the build-writtenoutandincludetrees. Editor write bursts such as "save all" settle into one rebuild. Edits made during a build aren't lost, and editor junk files never trigger rebuilds. The poll adapts to the walk cost, with a floor of 100 ms, so idle watch CPU stays near zero even on big projects. Native file-system events are a possible future refinement.- Declaration emit works for declaration-enabled builds. Declaration-path alias rewriting still has the Phase 4 limitation described in the roadmap.
- Native Flamework follows the v1.3.2 transformer reference through native parity tests.
- External transformer plugins run through the Node sidecar that the sloptor binary embeds. Sloptor extracts it on the first plugin build. The worker uses your project's own
typescriptinstall, the same instance that pluginsrequire, and stays warm across builds and watch rebuilds. - The conformance test runners are in the repo and green today. The external-project acceptance proof depends on the environment. It needs a local
randomnesscheckout, plus Rojo and Lune on the machine that runs it.