Comparison
Tern vs Rust
Rust gets memory safety from ownership and borrowing. Tern gets it by having no references at all: every value is a copy, so there’s nothing to borrow, and races are still compile errors.
curl -fsSL https://ternlang.dev/install.sh | sh
tern new myapp && cd myappNumbers
| Tern | Best Rust | |
|---|---|---|
| n-body | 896 ms | 982 ms |
| binary-trees | 326 ms, 99 MB | 343 ms, 96 MB mimalloc |
| JSON, 300k structs | 172 ms | 249 ms serde |
| fib, fork-join | 114 ms | 115 ms rayon |
| HTTP plaintext, one thread | 169k req/s | 149k axum |
| Rebuild after an edit optimized | 0.67 s | 26.4 s |
| Clean build | 1.67 s | 44.9 s |
| WebAssembly binary-trees, one thread | 3.75 s | 2.84 s |
What’s different
- No lifetimes, no borrow checker. Functions change a caller’s variable only through a
mutparameter with&at the call site, and arguments can’t overlap. - Reference counting with lazy copies instead of ownership. Nothing can form a cycle, so nothing leaks.
- No async/await. Green-thread tasks; a million spawned and joined in 41 ms against tokio’s 219 ms.
- Python-shaped syntax, which coding agents get right more often than lifetimes.
Pick Rust when
- You need crates.io, no_std or embedded targets, Windows, or explicit control over memory layout.
- You need a stable language today.
Questions
Is Tern as fast as Rust?
On our 10 compute benchmarks it is ahead or tied on all of them. Rust still wins single-threaded WebAssembly binary-trees and uses slightly less memory on native binary-trees.
Is Tern memory safe?
Yes. There are no pointers or references, values are reference counted with copy-on-write, and the compiler rejects data races in parallel code.
More about Tern
Web servers and APIs169k requests/s on one thread, 254 KB binary
Command-line toolsFlags into a struct, one static binary
Data processingCSV, JSON, regex and gzip faster than Rust
WebAssembly40 KB modules with TypeScript types
iOS and AndroidOne library for Swift and Kotlin
Start the tourInstall Tern and write a first program
Tern (ternlang) is an early release: the language will change, and so will these numbers. Benchmarks run on an Apple M4 Pro; the full tables, losses included, are on the home page.