Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Overview of Rust:

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:

//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.

C++ With FreeRTOS:

In general, FreeRTOS can work with or work alongside a C++ embedded application. All of the FreeRTOS headers are wrapped in extern "C" {}blocks to ensure correct linkage in a C++ application. Therefore, it is quite easy to get FreeRTOS to work with C++.

Pro and Cons/Languages

Rust

C++

Pros

Cons

  • No labels