Skip to content
Snippets Groups Projects
practicalSession-4.md 1.2 KiB
Newer Older


# Introducing Rust

During all the sessions, I talked about quality in terms of code validation: you write tests to check your program; you build Docker images to provide everybody with a packaged environment.

But, quality also comes with the programming language itself.
During the last years, Rust emerged as the programming language to build (more) robust, safe software systems (compared to C++ and C).
Mozilla created Rust to replace C++ in the development of Firefox. Their goal is to have a language more focused on memory access and errors.

Rust has no garbage collector, compiles to native code.


Rust may make C++ and C deprecated during the coming decade(s).


## Installation

Rust installer: https://rustup.rs


Then, `rustup default stable`


Then, install the tutorials: 

`curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash`


## Running Rustlings, the Rust tutorials


`cd rustlings`


Finally run to launch the exercises:

`~/.cargo/bin/rustlings watch`


Follow the given instructions while editing `rs` files with a text editor.


Focus on code quality:
- `variables4.rs`, what is the difference between mutability and immutability? Which relation with code safety?