Examples

Complete example projects demonstrating what Turbo is built for. Each includes source code, configuration, and tests.

Running Examples

cd examples/<example-name>
turbo run          # Build and run
turbo test         # Run all tests
turbo build        # Build only

simple-script -- Text Statistics Analyzer

Starter

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 |> upper

speed-server -- HTTP Speed Server

Intermediate

A high-performance HTTP server showcasing async I/O, concurrent request handling, and native performance.

Key features demonstrated:

  • Async functions and spawn
  • Channel-based communication
  • Concurrent request processing
  • Native compilation performance

web-dashboard -- Analytics Dashboard

Intermediate

A data analytics dashboard demonstrating structs, enums, pattern matching, and data processing pipelines.

Key features demonstrated:

  • Structs and impl blocks
  • Enums with data-carrying variants
  • Pattern matching for routing logic
  • Hashmap-based data aggregation

More Examples

The repository includes additional advanced examples:

ExampleDescription
task-agentREST API with AI agent for task management
web-apiProduction bookmarking API with JWT auth, WebSocket, rate limiting
desktop-appNative markdown editor with AI writing assistant
realtime-systemTrading order matching engine with zero-alloc hot paths
edge-wasmEdge image processing compiled to WebAssembly

All examples are available in the examples directory of the Turbo repository.