This page looks best with JavaScript enabled

About rust lang

 ·  ☕ 1 min read

Rust

Open-source language; 6000 contributors. MIT and Apache License

1
2
3
fn main() { 				
    println!("Hello!");
}

rustc main.rs // create main.exe
main.exe

Creating projects:

cargo new hello
structure created: /src/main.rs /.toml (dependencies), /.gitignore
cargo run
cargo run build

Focuses to be safe, secure, concurrent with combination of

  • Static typing: prevent errors at compile time
    compiler is very strict: reliable and have fewer bugs
    it catches a lot of errors that would normally go unnoticed: no never used variable possible
  • Dynamic typing: flexibility and easier refactoring
  • Ownership and borrowing: ensure that data is accessed safely and efficiently
  • Modern syntax and design, a mixture of assembler and a functional programming language, and it looks very strange to the uninitiated.
  • Like C++, it supports low-level code, high performance, and direct memory access.
  • Rust doesn’t have classes: use custom data types (structs..) to represent types of objects
  • Rust code uses snake case for function and variable names
    all letters are lowercase and underscores separate words
Share on

Nicolas Guinet
Nicolas Guinet
Consultant .Net, C, C++, Python, Go. Full Stack Html/Css/Js/Node. I like to experiment new trends everyday. IA/ML player focused on scientific topics.