Immutability by default
Rust defaults to immutable bindings:
let x = 5;
x = 6; // compile error: cannot assign twice
This forces you to think about where state changes. Code that cannot be mutated is easier to reason about and safe to share.
Type inference
Rust infers types from context:
let name = "Ada"; // inferred as &str
let age = 30; // inferred as i32
let pi = 3.14; // inferred as f64
If inference fails, you can annotate explicitly:
let x: f64 = 3.14;
The default integer type is i32 and floats are f64.