$ whois rust
Rust
first released in 2010 · by Graydon Hoare
$ guessprog --inspect rust
- year
- 2010
- paradigm
- multi paradigm
- family
- c like
- memory
- ownership
- binding
- static
- safety
- strong
RUST(7)
- AUTHORS
- Graydon Hoare
- HISTORY
- Graydon Hoare started Rust as a personal project in 2006 while working at Mozilla; by his own account it was prompted by a crashed elevator in his apartment building, a reminder of how often software fails because of memory bugs. Mozilla began sponsoring the project in 2009 and announced it publicly in 2010, hoping to build a safer, parallel browser engine called Servo. Rust 1.0 was released in May 2015, and the language reached memory safety without a garbage collector through its ownership and borrowing rules. The name is said to come from the rust fungi, remarkably robust organisms.
- USAGE
- A fast-growing systems language used for browsers, operating system components, cloud infrastructure, command-line tools and WebAssembly. It is now accepted in the Linux kernel and adopted by companies such as Amazon, Microsoft, Google and Cloudflare, and has topped the "most loved" (later "most admired") ranking of the Stack Overflow survey for years.
- SEE ALSO
- Rust on Wikipedia ↗
use Shape::*;
enum Shape {
Circle { r: f64 },
Rect { w: f64, h: f64 },
}
fn area(shape: &Shape) -> f64 {
match shape {
Circle { r } => std::f64::consts::PI * r * r,
Rect { w, h } => w * h,
}
}
fn main() {
let shapes = [Circle { r: 1.0 }, Rect { w: 2.0, h: 3.0 }];
let total: f64 = shapes.iter().map(area).sum();
println!("total area: {total:.2}");
}