Skip to content

wesleyscholl/ferroscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ¦€πŸ”­ Ferroscope

See Rust's power in real time. 16 live interactive demos covering ownership, zero-cost abstractions, fearless concurrency, async I/O, lifetimes, WASM, macros, and more β€” all in a blazing-fast terminal UI. Written in 100% Rust.

CI License: MIT Rust

Ferroscope Demo


Demos

Key Demo Level Step Control Quiz
1 Ownership & Borrowing Beginner βœ“ βœ“
2 Memory Management Beginner βœ“
3 Zero-Cost Abstractions Intermediate βœ“
4 Fearless Concurrency Beginner βœ“
5 Async/Await Intermediate βœ“
6 Performance Benchmarks Intermediate βœ“
7 Type System Intermediate βœ“ βœ“
8 Error Handling Intermediate βœ“ βœ“
9 Lifetimes Advanced βœ“ βœ“
0 Unsafe Rust Advanced βœ“
a WebAssembly Intermediate βœ“
b System Metrics Intermediate βœ“
c Compile-Time Guarantees Intermediate βœ“
d Cargo Ecosystem Advanced βœ“
f Embedded / no_std Intermediate βœ“
g Macros Intermediate βœ“ βœ“

Interactive Features

Step Control (N / P)

Demos marked βœ“ support manual step control. Press N to advance to the next conceptual step and P to go back β€” turn any animated demo into a self-paced tutorial.

Quiz Mode (T)

Every demo has a built-in quiz question. Press T to open the quiz overlay, then 1–4 to submit your answer. Your score is tracked across the session.

Rainbow Konami Mode πŸ¦€

Enter the classic Konami code (↑ ↑ ↓ ↓ ← β†’ ← β†’ B A) for a surprise. The entire UI switches to animated rainbow colors per-character. Press any navigation key to exit.

Particle Bursts ✨

Unlock achievements (visit demos, hit speed records) and watch particle effects burst across the screen.

Transition Wipe

Switching between demos triggers a smooth horizontal reveal animation.

VS Mode (V)

Toggle a side-by-side Rust vs C++ comparison panel on supported demos.

Explanation Panel (E)

Every demo ships with a prose explanation panel written by a Rustacean. Expand it with E and scroll with j/k.


Quick Start

# Clone
git clone https://github.com/wesleyscholl/ferroscope.git
cd ferroscope

# Build & run (release mode for best performance)
cargo run --release

# Or install globally
cargo install --path .
ferroscope

Options

Flag Description Default
--fps N Tick rate, 5–120 fps 30
--tour Auto-advance through all 16 demos off
--screenshot Headless text export of every demo off
--screenshot-dir <path> Output directory for screenshot exports ferroscope-screenshots
--version Print version and exit β€”

Key Bindings

Key Action
← / h, β†’ / l Previous / Next demo
1–9, 0 Jump to demo 1–10
a, b, c, d, f, g Jump to demo 11–16
Space Pause / Resume animation
R Reset current demo
N / P Step forward / back (step-control demos)
T Open quiz overlay
1–4 Answer quiz question (when quiz open)
+ / - Increase / decrease speed
V Toggle vs-mode (Rust vs C++)
E Toggle explanation panel
j / ↓ Scroll explanation down
k / ↑ Scroll explanation up
S Screenshot (save text export)
? Toggle help overlay
Q / Esc Quit
Konami code Activate rainbow CRAB MODE πŸ¦€

Requirements

  • Rust 1.87+
  • A 256-color terminal (iTerm2, Terminal.app, Alacritty, WezTerm, kitty, etc.)
  • Minimum 120 Γ— 34 terminal size recommended

Architecture

ferroscope/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs          # CLI args, terminal setup, run_app() event loop
β”‚   β”œβ”€β”€ app.rs           # App state: demos, particles, quiz, transitions, Konami
β”‚   β”œβ”€β”€ events.rs        # AppEvent enum + key_event_to_app_event()
β”‚   β”œβ”€β”€ theme.rs         # Rust-orange color palette, HSV rainbow helpers
β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”œβ”€β”€ header.rs    # Animated crab, rainbow Konami title, progress bar
β”‚   β”‚   β”œβ”€β”€ footer.rs    # Key hints, N/P + T dynamic hints, rolling Rust facts
β”‚   β”‚   β”œβ”€β”€ nav.rs       # Tab bar with difficulty badges and mouse support
β”‚   β”‚   β”œβ”€β”€ layout.rs    # Responsive layout calculation
β”‚   β”‚   β”œβ”€β”€ quiz.rs      # Quiz overlay widget with score tracking
β”‚   β”‚   └── widgets/     # GaugeBar (pulse), FlameGraph (gradient), SparklineExt, ...
β”‚   └── demos/
β”‚       β”œβ”€β”€ mod.rs       # Demo trait + DemoRegistry
β”‚       β”œβ”€β”€ d01_ownership/   d02_memory/   d03_zero_cost/
β”‚       β”œβ”€β”€ d04_concurrency/ d05_async/    d06_performance/
β”‚       β”œβ”€β”€ d07_type_system/ d08_error_handling/ d09_lifetimes/
β”‚       β”œβ”€β”€ d10_unsafe/  d11_wasm/  d12_system_metrics/
β”‚       β”œβ”€β”€ d13_compile_time/ d14_cargo_ecosystem/ d15_no_std/
β”‚       └── d16_macros/      # macro_rules!, hygiene, proc-macros, C vs Rust
└── benches/             # criterion benchmarks: sort, alloc, iter

Re-generating the Demo GIF

The demo GIF is produced with VHS:

brew install vhs          # macOS β€” also installs ffmpeg + ttyd
cargo build --release
vhs demo.tape             # outputs assets/demo.gif

License

MIT β€” see LICENSE.