Rust
A systems programming language focused on safety, speed, and concurrency without a garbage collector. Rust's ownership system prevents memory errors at compile time. Used for OS components, browsers, CLI tools, and performance-critical services. Steep learning curve but zero-cost abstractions.
- Systems programming (OS, browsers, engines).
- Performance-critical services.
- CLI tools.
- WebAssembly targets.
- Quick scripts (use Python).
- Rapid prototyping where compile time hurts.
- Simple CRUD backends (use Go/Python/Node).
Definition
Rust is a statically typed, compiled language with an ownership/borrowing model that guarantees memory safety without GC. No null, no data races. Traits for polymorphism, enums for algebraic types, and pattern matching. cargo is the build tool and package manager.
Why it exists
C/C++ are fast but unsafe (memory bugs, data races). Managed languages (Go, Java) are safe but have GC pauses. Rust gives both safety and performance via compile-time ownership checks.
How it works
The ownership system: each value has one owner, borrowed references have lifetimes, the compiler checks all memory access at compile time. No GC needed. cargo builds, tests, and manages crates. Zero-cost abstractions: high-level patterns compile to efficient machine code.
Scaling limits
Steep learning curve (ownership, lifetimes, borrowing). Compile times are long for large projects. Some patterns are hard to express (self-referential structs). Smaller ecosystem than Go/Python for web.
Cost shape
Free and open source.
Alternatives
- Go — Simpler and faster to write, GC pauses, less safety.
- C++ — Faster compile, equally fast, but unsafe memory.
Failure modes
- Fighting the borrow checker.
- Long compile times.
- Steep learning curve.