RUST Programming Language – What do You Need to Know in 2022

I come across this programming language as I was exploring the Solana cryptocurrency smart contract development this year. Before we dig into the smart contract, I need to understand this language first as this is quite intimidating as I am coming from C# and the syntax is weird and this is dealing with low-level language similar to C++ or C πŸ™‚


Use the following environment:

  • Windows 11
  • WSL installed
  • Visual Studio Code installed


Rust is a system programming language and a very low-level language similar to C++ and C.

Rust has no garbage collector.

Rust is a memory safety guarantee ie. dangling pointers, null pointer exceptions, data races, iterator invalidation and more.

Rust is like C and it’s not Object-Oriented. The β€œclass” is using the β€œstruct” and the implementation is using imp<>.

Access WSL

After installing WSL on Windows 11, to access the terminal, run the wt.exe



Install Rust

On the terminal, type in:

curl --proto '=https' --tlsv1.2 -sSf | sh

Update and Version

To update:

rustup update

To check the version:

rustc --version

Note: By the time this blog is written, the latest version is 1.60.0.

Run Visual Studio Code

Launch the Visual Studio Code.

Press Ctrl + Shift + X to launch the Extension.

Install the rust-analyzer extension.

Note: Do not install the Rust extension as this extension is a legacy and eventually will get replaced with a rust-analyzer as the main one. Rust-analyzer has an auto-completion, a definition pops up, code formatting, etc.

Creating the Project

On the Visual Studio Code top navigation, select the File > Open Folder

Navigate to the user /home folder. Click the Ok button.

On the Visual Studio Code top navigation, select the Terminal > New Terminal

Navigate to the folder:

cd ~/

Create the folder of the application domain, i.e: dewacorp, solana-labs, etc

mkdir test-app-domain

Go to the application domain:

cd test-app-domain

Create the application using Cargo:

cargo new test-app

Run the test app, you can either use:

Via Cargo and go to the right folder

cd test-app
cargo run

or you got the src:

cd test-app
rustc ./src/

This will generate a binary called the main

To run the binary:


Delete the test application domain if no longer needed:

rm -r test-app-domain

In Visual Studio, open up the workspace for a specific application by going to open the folder and navigating the folder into the application. Click the OK button.

Refactoring for changing the variable, press F2 and change the variable. The rust-analyzer will replace the variable inside the scope and will check if there is a similar name.


The & indicates that this argument is a reference, which gives you a way to let multiple parts of your code access one piece of data without needing to copy that data into memory multiple times.



There are three solutions for managing the memory: Manual Memory Management (C, C++), Garbage Collection (Java and C#), and Ownership model (Rust).

The pros and cons of these three:

Manual Memory ManagementControl over memory
Faster Runtime
Smaller program size
Slower write time
Garbage CollectionNo error
Faster write time
No control over memory
Slower runtime performance
Larger program size
RustControl over memory
No error
Faster runtime
Smaller program size
Slower write time

This concept is very crucial to understanding the memory – stack and heap. If you are coming from C# or Java stuff, this concept needs to be understood very clearly.


Tim McNamara – How to Learn Rust –

The Rust Programming Language –

Free Code Camp – Rust in Replit –

Rust Language Community –

Rust Discord –

Rust Users Forum –

Getting Started with Rust in Visual Studio Code –

Learn Rust by Ryan Levick (@ryan_levick) –

Learn Rust by Microsoft Developer –

Rust Meet Up –

Microsoft Learn Rust –