Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Rust is a general-purpose systems programming language that spans both high level and low level that is statically typed. The benefit of using rust, in general, is that it is a much safer programming language compared to others; Rust checks for all memory accesses so it is impossible to corrupt the memory, meaning that if the program compiles successfully, then it is very unlikely for the program to contain any blindspots for errors. In terms of Rust’s syntax, it is quite similar to C as shown in the following:

Code Block
breakoutModewide

Rust With FreeRTOS:

...

languagerust
//Filename: src/main.rs
//Functions in Rust starts with 'fn' followed by the function name and then a set of parentheses.

fn main() {
    print_labeled_measurement(5, 'h');
}

fn print_labeled_measurement(value: i32, unit_label: char) {
    println!("The measurement is: {}{}", value, unit_label);
}

Rust also comes with its own build system and package manager called 'Cargo'. Cargo can be thought of as a compiler where it can build the code, but it can also download the libraries that the code needs as well as build these libraries, and these libraries are called dependencies.

What is Rust’s used for?

Rust can be used for topics such as operating system development, web services, command-line tools and others. Rust is an ideal programming language for those who seek efficiency and security. Rust is also very good for concurrency and memory safe.

Overview of C++:

Many people know C++ since it is essentially an extension of the C language. C++ compromises a combination of both high-level and low-level language features.

...