# Rust — Memory-Safe Systems Programming Language > Rust is a systems programming language focused on safety, speed, and concurrency. Memory safety without garbage collection via its ownership model. Powers Firefox, Cloudflare, Discord, AWS Firecracker, and a growing share of core infrastructure. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash # Install via rustup curl --proto =https --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env rustc --version cargo --version ``` Hello world: ```rust // src/main.rs use std::collections::HashMap; fn main() { let mut counts = HashMap::new(); for word in "hello world hello rust".split_whitespace() { *counts.entry(word).or_insert(0) += 1; } for (word, count) in &counts { println!("{word}: {count}"); } } ``` Cargo commands: ```bash cargo new my_project --bin cd my_project cargo run cargo build --release cargo test cargo clippy # Lint cargo fmt # Format cargo add serde --features derive cargo publish cargo install ripgrep # Install global tool ``` ## Intro Rust is a systems programming language focused on safety, speed, and concurrency. It guarantees memory safety without using garbage collection, thanks to a unique ownership and borrowing model enforced at compile time. Originally designed by Graydon Hoare at Mozilla starting 2006, now governed by the Rust Foundation. Powers Firefox, Cloudflare Workers, Discord backend, AWS Firecracker, and a growing share of critical infrastructure. - **Repo**: https://github.com/rust-lang/rust - **Stars**: 111K+ - **License**: Apache 2.0 + MIT (dual) ## What Rust Does - **Ownership system** — each value has a single owner, borrowed references checked at compile time - **Zero-cost abstractions** — high-level code compiles to optimal low-level output - **No null, no exceptions** — Option and Result types for absent/error values - **Pattern matching** — exhaustive match expressions - **Trait system** — structural polymorphism - **Fearless concurrency** — data races prevented by borrow checker - **Cargo** — package manager and build tool built in - **WebAssembly** — first-class compilation target - **Async/await** — since Rust 1.39 ## Architecture Compiler (rustc) built on LLVM backend. Uses MIR (Mid-level Intermediate Representation) for borrow checking, then LLVM IR for optimization. Cargo manages dependencies from crates.io, the community package registry. Language evolves through an RFC process. ## Self-Hosting Language toolchain. ## Key Features - Memory safety without GC - Zero-cost abstractions - Ownership + borrowing - Pattern matching - Trait-based generics - Cargo build system - crates.io package registry - Async/await support - WebAssembly target - Excellent tooling (clippy, rustfmt, rust-analyzer) ## Comparison | Language | Memory Safety | Runtime | Bundle Size | |---|---|---|---| | Rust | Compile-time (ownership) | No GC | Small | | C | Manual | None | Smallest | | C++ | Manual + RAII | None | Small | | Go | Runtime (GC) | GC | Medium | | Swift | ARC (ref counting) | Small | Medium | | Zig | Manual (+ tools) | None | Small | ## FAQ **Q: How steep is the learning curve?** A: The first week or two you will wrestle with the borrow checker (learning ownership and lifetimes). Once comfortable, productivity is very high. The Rust compiler's error messages are among the best in the industry. **Q: When to choose Rust?** A: Systems programming, performance-sensitive CLI tools (ripgrep, bat, fd), WebAssembly, blockchain, embedded, game engines, and database engines. **Q: Compile speed is slow?** A: It's one of Rust's pain points. Mitigations: incremental compilation, cargo check (fast type check), sccache, and splitting into a workspace. v1.x is continuously optimizing. ## Sources - Docs: https://www.rust-lang.org/learn - GitHub: https://github.com/rust-lang/rust - License: Apache 2.0 + MIT --- Source: https://tokrepo.com/en/workflows/rust-memory-safe-systems-programming-language-1b74899e Author: AI Open Source