Skip to content

peiyan03/happy_ruster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

🦀 Rust CLI Learning Suite

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.

Prerequisites

  • A modern web browser (Chrome, Firefox, Edge).
  • For the AI Tutor: A valid Google Gemini API Key.

Installation

  1. Clone the repository:

    git clone https://github.com/peiyan03/happy_ruster.git
  2. Launch a Game:

    • CLI Master: Open index.html in your browser.
    • AI Tutor: Open smart_rust_tutor.html in your browser.

⚙️ Configuration (AI Tutor Only)

To enable the "Rusty" AI Tutor:

  1. Open smart_rust_tutor.html in a code editor.

  2. Locate the configuration line:

    const apiKey = "YOUR_GEMINI_API_KEY_HERE";
  3. Paste your API key inside the quotes.


🧠 Deep Dive: The Modules

1. Rust CLI Master (rust_CLI.html)

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 build and cargo build --release.

2. Rust AI Learner (rust_ai_learner.html)

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.

  1. Fork the Project.

  2. Create your Feature Branch:

    git checkout -b feature/AmazingFeature
  3. Commit your Changes:

    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch:

    git push origin feature/AmazingFeature
  5. Open a Pull Request.


Built with ❤️ and 🦀 for Rustaceans everywhere.

About

This is the repo I created to help me learn rust, by using AI I also added some games to help me learn rust, it is an ongoing project...

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors