Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Examples

Real Rask programs that demonstrate practical patterns.

All example code is in the repository’s examples/ folder and runs on the current interpreter.

Available Examples

Running Examples

git clone https://github.com/dritory/rask.git
cd rask/compiler
cargo build --release
./target/release/rask ../examples/grep_clone.rk --help

View all examples on GitHub →

What These Demonstrate

Each example showcases key Rask concepts:

Grep Clone

  • CLI argument parsing
  • File I/O with error handling
  • String operations
  • Resource cleanup with ensure

Game Loop

  • Entity-component system using Pool<T>
  • Handle-based indirection
  • Game state management

Text Editor

  • Command pattern for undo/redo
  • File I/O and resource management
  • State transitions