Introduction to Turbo
A compiled, type-safe programming language with JavaScript's developer experience, Rust's performance, and a modern built-in toolchain.
JavaScript's soul. Rust's speed. Honest about what ships today.
What is Turbo?
Turbo compiles directly to machine code using Cranelift. No interpreter, no VM, no garbage collector. Programs start instantly and run at native speed. It features strong static typing with type inference, generics, traits, and algebraic data types -- all while keeping a clean, approachable syntax.
Key Features
- Native compilation -- JIT via
turbolang run, AOT viaturbolang build - Type-safe -- Generics, traits, pattern matching, Result/Optional types
- Thread-based concurrency -- spawn, await, channels, mutex
- Small, honest core -- Turbo keeps the compiler focused on a general-purpose language. Agent/tool workflows will ship in a separate
turbo-agentlibrary after 1.0, not as compiler keywords - Modern toolchain -- built-in test runner, formatter, REPL, LSP, package manager
- Tiny binaries -- ~93 KB for a hello world, no runtime dependencies
A Quick Taste
fn fib(n: i64) -> i64 {
if n <= 1 {
n
} else {
fib(n - 1) + fib(n - 2)
}
}
fn main() {
let mut i = 0
while i <= 15 {
print(fib(i))
i += 1
}
}Who is Turbo for?
- Developers who want native performance without Rust's complexity
- Teams that want native-speed tooling today with a core small enough to stay stable
- Anyone who wants a modern language with batteries included
- Systems programmers who appreciate clean, expressive syntax
Performance
Recursive fib(40) is a CPU microbenchmark (function-call and recursion overhead), not a real-world workload. Best of 5 wall-clock runs on an Apple M5 Max (macOS 26.5.1, 2026-06-27), Turbo's AOT build vs native and interpreted baselines:
| Language | Time | Binary Size |
|---|---|---|
| C (clang -O2) | ~265 ms | 33 KB |
| Rust (rustc -O) | ~265 ms | 455 KB |
| Turbo (AOT, Cranelift) | ~330 ms | 93 KB |
| Go (go build) | ~340 ms | -- |
| Node.js 22 | ~680 ms | -- |
| Python 3.10 | ~13.3 s | -- |
On this microbenchmark Turbo's native output runs about 1.25–1.3x slower than C and Rust, sits in the same range as Go, and is far ahead of the interpreted runtimes — while emitting a self-contained ~93 KB binary. Reproduce with ./turbo/benchmarks/run_comparison.sh.
Real-world workload: word-count
fib40 only exercises the integer call stack. The word-count benchmark is end-to-end: read a ~5 MB text file (1.05M words), tokenize on whitespace, count word frequencies in a hashmap, and print the top-20 words plus a total — exercising file I/O, strings, hashmaps, and sorting. The C/Rust/Go baselines implement the identical algorithm over the identical, deterministically generated input, and the runner fails unless all four languages produce byte-for-byte identical output.
| Language | Time | vs C |
|---|---|---|
| C (clang -O2) | ~108 ms | 1.00x |
| Rust (rustc -O) | ~110 ms | ~1.02x |
| Go (go build) | ~120 ms | ~1.11x |
| Turbo (AOT, Cranelift) | ~150 ms | ~1.4x |
| Turbo (JIT) | ~205 ms | ~1.9x |
Honest framing: on this string/hashmap-heavy workload Turbo's native output runs about 1.4x slower than C (down from ~2.2x). The earlier gap came from the str→int map re-stringifying, re-parsing, and re-allocating the value on every increment; int values are now stored inline in the hashmap entry, so the counter loop does a single hash + single probe with no per-update allocation. It's a real workload with reproducible numbers. Reproduce with ./turbo/benchmarks/run_wordcount.sh.