📜 What is Rust?

Adelar da Silva Queiróz
2 min readJul 14, 2020

Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.

This language exposes lower level concepts but using high level features like:

  • zero-cost abstractions
  • move semantics
  • guaranteed memory safety
  • threads without data races
  • trait-based generics
  • pattern matching
  • type inference
  • minimal runtime
  • efficient C bindings
  • programmers love Rust 🎉

Also has a growing number of tools. You can do almost anything, since Web stuff until Operating Systems.

Rust first appeared in 2010 (first commit) and the 1.0 release was at May 15, 2015). Even so is already been used in many companies (1, 2, 3) in production enviroment.

This is how the code looks like:

fn main() {
// A simple integer calculator:
// `+` or `-` means add or subtract by 1
// `*` or `/` means multiply or divide by 2
let program = "+ + * - /";
let mut accumulator = 0;
for token in program.chars() {
match token {
'+' => accumulator += 1,
'-' => accumulator -= 1,
'*' => accumulator *= 2,
'/' => accumulator /= 2,
_ => { /* ignore everything else */ }
}
}
println!("The program \"{}\" calculates the value {}",
program, accumulator);
}

Surprise! You can run the code above clinking here! 😊

Original on my daily-rust blog.

--

--

Adelar da Silva Queiróz

I’m a software enginner living on Cascavel, Brazil. I work with mainly all things related with software.