Gamifying the steep learning curve of systems programming.
Explore the Games • Installation • Contributing
📖 About The Project
Rust CLI Learning Suite is a collection of web-based mini-games and tools designed to teach the Rust programming language through immersion rather than dry documentation.
Rust is famous for its steep learning curve. This repository aims to flatten that curve by offering two distinct "modes" of learning:
- Muscle Memory: Repetitive practice of CLI commands.
- Intelligent Feedback: AI-driven code analysis and tutoring.
🕹️ The Arcade
This repository currently contains two distinct prototypes:
| Game / Module | Type | Tech Stack | Learning Objective |
|---|---|---|---|
| Rust CLI Master | 📟 Terminal Sim | HTML, JS, DOM | Master the cargo lifecycle (new, build, check, run) in a risk-free, simulated terminal environment. |
| Rust AI Learner | 🤖 Intelligent IDE | Gemini API, Tailwind | A mock compiler powered by AI that explains why your code failed the borrow checker in plain English. |
🚀 Getting Started
Since these are client-side web applications, no complex Rust installation is actually required to run the learning tools themselves.
- A modern web browser (Chrome, Firefox, Edge).
- For the AI Tutor: A valid Google Gemini API Key.
-
Clone the repository:
git clone https://github.com/peiyan03/happy_ruster.git
-
Launch a Game:
- CLI Master: Open
index.htmlin your browser. - AI Tutor: Open
smart_rust_tutor.htmlin your browser.
- CLI Master: Open
To enable the "Rusty" AI Tutor:
-
Open
smart_rust_tutor.htmlin a code editor. -
Locate the configuration line:
const apiKey = "YOUR_GEMINI_API_KEY_HERE";
-
Paste your API key inside the quotes.
🧠 Deep Dive: The Modules
A gamified terminal that strictly enforces Cargo command syntax.
- Features: Detailed mission briefings, CRT screen effects, and instant error feedback.
- Why it helps: Beginners often freeze when facing a blank terminal. This provides guardrails to learn the difference between
cargo buildandcargo build --release.
A simulator that pretends to be a Rust compiler.
- Features: Syntax highlighting (simulated), progressive curriculum levels, and a chat interface.
- Technology: Instead of compiling code via WebAssembly (which is heavy), this uses the Gemini API to "read" your code and predict if it would compile, offering human-readable explanations for errors like specific mutability violations or shadowing issues.
🛣️ Roadmap
- Persistency: Save progress to LocalStorage.
- WASM Integration: Replace the CLI simulator with actual Rust code running in the browser via WebAssembly.
- Curriculum Expansion: Add levels covering ownership, lifetimes, and traits.
🤝 Contributing
Contributions are what make the open-source community such an amazing place to learn. Any contributions you make are greatly appreciated.
-
Fork the Project.
-
Create your Feature Branch:
git checkout -b feature/AmazingFeature
-
Commit your Changes:
git commit -m 'Add some AmazingFeature' -
Push to the Branch:
git push origin feature/AmazingFeature
-
Open a Pull Request.
Built with ❤️ and 🦀 for Rustaceans everywhere.