What it is
Rust is a statically typed systems language. Its distinctive idea is ownership: each value has an owner, and the compiler tracks who may read or change it. When the owner goes out of scope, the value is freed. There is no garbage collector in the usual runtime, and there is no manual free in safe code. The borrow checker rejects programs that would use memory after it was freed or change it through two writers at once. The cost is compile errors that feel personal until the model clicks.
Rust is used for CLI tools, browsers' components, embedded work, WebAssembly, and some network services. It is not a scripting language. Cargo is the build tool and package manager; a library is a crate.
Why and when it is used
Choose Rust when memory safety bugs are unacceptable and a garbage collector is the wrong trade (a library other languages will embed, a tight loop, a parser that must not surprise you). Choose it when you want one toolchain that can target native code and WASM. Choose it for a new component beside a slower language: a Python service can call a Rust extension for the hot part.
Do not choose Rust for a CRUD form, a one-off script, or a team that needs to ship a simple API this month and has never seen the borrow checker. Go or Java will get you there with less ritual. Rewriting a working service in Rust "for performance" without a profile is a hobby, not a plan.
How it works
You declare ownership by how you pass values. A move transfers ownership. A borrow (&T or &mut T) lends it. Lifetimes describe how long a borrow lasts; the compiler often infers them. Result and Option replace exceptions and null for ordinary failures. You handle them or propagate them with ?. Unsafe blocks exist for code the compiler cannot prove, and they are a small, reviewed surface, not the default style.
Cargo downloads crates, runs tests, and builds release binaries with optimisations. Compile times are the tax. Incremental builds help; clean release builds of large projects do not feel like Go. The reward is a class of bugs that do not survive until production.
Technologies and dependencies
rustup installs the toolchain so you can pin a stable version. Cargo and crates.io supply libraries. For HTTP, the ecosystem has mature async runtimes (Tokio is the common one) and web frameworks on top. Async Rust is a second learning curve; do not start there. Containers need a build image with the toolchain and a slim runtime image. You rarely need a system-wide runtime the way Python does.
How to get started
- Install rustup and the stable toolchain.
cargo newa binary project. - Write a function that reads a file into a
Stringand returnsResult. Propagate errors with?. Do not unwrap everything. - Intentionally keep a reference to a local and read the compiler error until it makes sense. That error is the lesson.
- Add a unit test.
cargo test. - Only after that, look at a web framework or WASM. Add Tokio when you have a concurrent I/O problem, not before.
- Use
clippyonce the program is real. Fix the warnings you understand; do not silence the linter on day one.
The book The Rust Programming Language is the standard free text. Random snippets that unwrap in production style will teach you to crash.
Cautions and trade-offs
The learning curve is the main cost. Teams that adopt Rust for everything write less product while they fight the compiler. Adopt it at a boundary. Async, macros and lifetime-heavy libraries stack the difficulty. Prefer boring, owned data (String, Vec) until you must optimise.
Unsafe and unwrap on library errors are how Rust programs still crash. Treat unwrap in a server as a bug unless the invariant is local and obvious. Supply-chain risk is the same as any crate ecosystem: review what you add. Compile times can hurt CI if you structure the crate graph badly. And do not sell Rust as "faster than Go" in the abstract. It can be, when the problem is CPU and allocations. Many services are limited by a database, and the database does not care which language waited on it.