Examples
Turbo ships a mix of runnable examples you can execute today and roadmap examples that document planned language features. This page separates the two so the product surface stays clear.
Two example tiers
- Runnable today: examples under
examples/compile with the current toolchain. - Roadmap / planned: examples under
examples/roadmap/are design references and are not expected to compile yet.
Running examples today
Runnable examples are simple entry-point projects with README notes and executable main.tb files. Run them directly with the CLI:
turbolang run examples/web-dashboard/main.tb
turbolang run examples/simple-script/main.tb
turbolang run examples/speed-server/main.tb
turbolang build examples/todo-cli/main.tbweb-dashboard -- Flagship Browser Demo
Runnable todayBest first runHero example
The clearest single demo of what Turbo can do today: one Turbo file serves a styled HTML dashboard plus five JSON benchmark endpoints. This is the fastest way to prove the compiler, runtime, and browser story all work together.
Quickstart
turbolang run examples/web-dashboard/main.tb
# then open http://localhost:3000Try this in the browser
- Click Run All Benchmarks
- Open
/api/infoin a second tab - Leave the terminal running until you press Ctrl+C
Key features demonstrated:
- HTML UI plus JSON routes from one Turbo process
- HTTP routing and browser-facing responses
- CPU-bound benchmark endpoints you can trigger live
- String-built HTML/CSS/JS without extra dependencies
- Runnable today with the current compiler
simple-script -- Text Statistics Analyzer
Runnable todayStarter
A text analysis tool that demonstrates Turbo's core features: functions, strings, arrays, hashmaps, the pipe operator, and string interpolation.
Key features demonstrated:
- Pipe operator for data flow
- String operations (trim, upper, lower, split, replace)
- Hashmap-based word frequency analysis
- Array operations (map, filter, reduce)
- String interpolation in print statements
// Pipe operator for clean data flow
let chars = text |> count_chars
let words = text |> count_words
// String operations pipeline
let sample = " Hello, Turbo World! "
let cleaned = sample |> trim
let upper = cleaned |> upperspeed-server -- HTTP Speed Server
Runnable todayIntermediate
A high-performance HTTP server example showcasing Turbo's current HTTP primitives, JSON responses, and benchmark-style endpoints.
Key features demonstrated:
- HTTP routing and request handling
- JSON responses
- CPU-bound benchmark endpoints
- Native compilation for server-style workloads
More runnable examples
| Example | Description | Status |
|---|---|---|
todo-cli | Task manager with file I/O and structs | Runnable today |
data-pipeline | Log analysis engine with parsing and aggregation | Runnable today |
game-of-life | Conway's Game of Life with string-grid updates | Runnable today |
Roadmap examples
These examples are design references for features still in development. They help explain where Turbo is headed, but they are not runnable with the current compiler.
| Example | Description | Status |
|---|---|---|
web-api | Production-style bookmarking API with JWT auth and WebSocket routes | Planned / not runnable yet |
realtime-system | Trading order matching engine with zero-allocation ambitions | Planned / not runnable yet |
edge-wasm | Edge image processing pipeline targeting future WASM workflows | Planned / not runnable yet |
Browse the full set of runnable and roadmap examples in the examples directory of the Turbo repository.