Why sloptor
There are already two other ways to build a roblox-ts project. One is rbxtsc itself. The other is rbxtsgo, a Go rewrite on top of the same native TypeScript compiler. rbxtsgo already makes the case that a native compiler outruns the JS one, so this page doesn't spend time on that. It covers what sloptor does beyond that, and where rbxtsgo is still the better pick. A third, rbxtsc-rs, is an experimental Rust port of roblox-ts and Flamework. The numbers below include it, but the feature comparison doesn't cover it yet.
The numbers
Section titled “The numbers”On the benchmark projects, a cold sloptor build is 1.76× faster than rbxtsgo, 1.21× faster than rbxtsc-rs, 1.36× faster than rbxts-rs, and 25.2× faster than rbxtsc. A no-op rebuild is 6.64×, 9.48×, 9.57×, and 115.9× faster. Those are geometric means over seven projects, from one file to 401. rbxtsc-rs failed every run of async, so its means leave that project out. rbxts-rs failed every run of algorithms, containers, async, roblox-api, obby, so its means leave those projects out.
| Scenario | Against | Time | CPU | Memory | Instructions | Time, per project |
|---|---|---|---|---|---|---|
| Cold build | rbxtsgo | 1.76× | 2.58× | 1.74× | 2.50× | 1.63× to 2.11× |
| Cold build | rbxtsc-rs | 1.21× | 1.41× | 1.55× | 1.46× | 1.04× to 1.29× |
| Cold build | rbxts-rs | 1.36× | 1.70× | 1.11× | 1.24× | 1.25× to 1.47× |
| Cold build | rbxtsc | 25.2× | 28.2× | 5.43× | 27.6× | 21.9× to 30.4× |
| One-file edit | rbxtsgo | 1.71× | 3.01× | 1.66× | 2.59× | 1.48× to 1.86× |
| One-file edit | rbxtsc-rs | 1.72× | 2.75× | 2.00× | 2.72× | 1.32× to 2.39× |
| One-file edit | rbxts-rs | 1.21× | 1.80× | 1.03× | 1.16× | 1.15× to 1.28× |
| One-file edit | rbxtsc | 23.2× | 32.8× | 6.24× | 31.0× | 18.0× to 25.4× |
| No-op rebuild | rbxtsgo | 6.64× | 17.8× | 6.25× | 17.2× | 5.16× to 9.41× |
| No-op rebuild | rbxtsc-rs | 9.48× | 23.1× | 9.62× | 26.4× | 6.17× to 14.7× |
| No-op rebuild | rbxts-rs | 9.57× | 17.2× | 5.09× | 12.6× | 5.81× to 15.8× |
| No-op rebuild | rbxtsc | 115.9× | 256.4× | 29.1× | 281.2× | 85.7× to 144.6× |
- CPU and instructions differ more than wall time does: against rbxtsgo, a cold sloptor build uses 2.58× less CPU time and 2.50× fewer instructions. Wall time improves by 1.76×. Both tools check in parallel, so the lead isn't only a matter of more threads.
- The rbxtsgo gap is small in milliseconds: it's 15.0 ms on the one-file
helloproject and 51.0 ms on the 401-filewideproject, and the ratio doesn't grow steadily with size, so don't extrapolate it to your game. - rbxtsc-rs is closest on a cold build and furthest on a rebuild: it trails by 1.21× from cold but 9.48× on a no-op rebuild, and it's slower than rbxtsgo there. rbxtsgo is the other way around.
- The rbxtsc gap is the structural one: rbxtsc boots Node and typechecks on one JS thread, and no amount of tuning changes that. From cold it runs 21.9× to 30.4× slower than sloptor across the seven projects.
- Scope: every number came from sloptor 3.0.0-beta.7 on an Apple M4 Pro. rbxtsgo publishes its own figures on a Windows desktop and a closed-source game, so you can't compare those with these. The benchmarks page has the method and the command to rerun it on your own project.
What sloptor does that a faster rbxtsc doesn't
Section titled “What sloptor does that a faster rbxtsc doesn't”A native build of the same emit isn't unique to sloptor. These are the reasons to pick it beyond that.
- Fixes for output rbxtsc gets wrong: a
switchwith acaseafterdefaultselects the first matching case, sopick("b")returns2in sloptor and0underrbxtsc3.0.0, which drops the case. Cases also compare against the original operand, and numericforloops re-read bounds that change. These are deliberate divergences, so the Luau won't be byte-identical torbxtscfor every file. - Native Flamework and jecs: rbxtsgo's README says builds using a transformer plugin other than setget go to the JS compiler and run at JS speed, with Flamework as its example. sloptor runs Flamework natively when you opt in, and runs
rbxts-transformer-jecsnatively when the installed package matches the build the port targets. Other plugins go through an embedded Node sidecar. - Syntax rbxtsc rejects: loop labels and named function expressions compile instead of failing with
labels are not supported!. The ones sloptor can't lower give a diagnostic, never wrong output. - Compile-time macros:
$env,$keys,$nameof,$file, and$getModuleTreeare built in.$envand$keysdo the jobs ofrbxts-transform-envandrbxts-transformer-keys, so those two plugins can leavecompilerOptions.plugins. Node is only needed if you still use some other external plugin. See Macros. - Diagnostics that fit a toolchain: errors render as code frames,
--jsongives one result object per build, andbuild -w --jsonstreams NDJSON for tools that supervise the watcher.sloptor diagnosticsreports every file's outcome instead of stopping at the first type error, which matters because a single type error hides every transformer diagnostic in a normalbuild. - Editor support for what TypeScript can't see:
sloptor lsppublishes transformer diagnostics such asnoAnyand unsupported-construct errors for unsaved buffers, next to your normal TypeScript server. - A programmatic API: the typed JavaScript
createBuildSession()client lets other tools drive builds. See Install. - Opt-in output tuning:
--optimized-array-appendsturns eligibleArray.pushcalls in loops into indexed writes,//!nativefiles get Luau type annotations behind thenativeTypesoption, and--luau-typesis an experimental full-annotation mode. All are off by default. See Building. - Prebuilt binaries. The install page lists the supported platforms. rbxtsgo's README says its author has only run it on Windows x64 so far, though it builds binaries for other platforms.
sloptor aims to match rbxtsc 3.0.0 everywhere else, and the differential tests in the repo check that. Treat the changelog as the list of known exceptions.
Where rbxtsgo is the better pick
Section titled “Where rbxtsgo is the better pick”- You use setget: rbxtsgo has
rbxts-transformer-setgetbuilt in, with diagnostics pointing at the right line of your source. sloptor has no native setget, so it would run as an external plugin through the Node sidecar. - You want its emit fixes: rbxtsgo's optional
--fix-emitrepairs a few knownrbxtscbugs. sloptor has no equivalent flag. - You can't feel the gap: on a project without plugins, rbxtsgo may already build in a few dozen milliseconds. Moving over then changes little you would notice.
And rbxtsc stays the reference. The numbers and byte-comparisons on this page all use it as the baseline. If your project depends on something sloptor hasn't ported, the roadmap and the "not yet supported" diagnostics say so up front.
Prior work
Section titled “Prior work”- roblox-ts is the compiler whose emit sloptor ports, and the oracle for its output.
- @isentinel/roblox-ts is the fork whose changed behavior sloptor follows where it differs from upstream.
- typescript-go and tsrs are the native TypeScript compiler and its Rust port that sloptor type-checks with.
- rbxtsgo is the other native roblox-ts compiler, written in Go on TypeScript 7's Go compiler. It's one of the other native tools in the benchmarks.
- rbxtsc-rs is an experimental Rust port of roblox-ts and Flamework, built on tsc-rs, a different Rust port of TypeScript 7 than tsrs. It's the third rival in the benchmarks.
- rbxts-rs is a Rust port of roblox-ts built on tsrs (TypeScript 7.1), focused on byte-for-byte output parity with stock roblox-ts. It's the fourth rival in the benchmarks.
See Architecture for how the pieces fit, and Migrate from rbxtsc when you're ready to switch.