Most Loved Languages in This Century, Rust

“Wondering if there is a programming language that is as fast as C/C++ and as safe as Ruby/Python, it would be beyond perfection…”

Geoffrey Aaron
eCloudture
3 min readMay 5, 2021

--

Based on Stack Overflow Developer Survey 2020, The Most Loved programming language was achieved by Rust. Since its launch in 2010, Rust has stolen the attention of the developer’s community with its superiority.

Rust is an open-source programming language focused on safety, speed, and concurrency. With Rust, you can write faster, more reliable software.

The first appearance of Rust was on July 7, 2010. It was created by Graydon Hoare and sponsored by Mozilla Research. Back in 2010, Graydon Hoare presented work on Rust, and he hoped Rust would become a “Memory Safety and More Concurrency” programming language. One of the famous platforms, Figma, already used Rust in their production environment. There are also many organizations using Rust in production, such as Dropbox, Coursera, etc.

Why do we should use Rust ?

Even though Rust and C /C++ have almost same speed and performance, the Even though Rust and C /C++ have almost the same speed and performance, the big difference is that Rust is safe by default, which means the rate of successful compile is much higher. Rust will guarantee of correctness of your code than another programming language. With Rust’s characteristics, statically (all types are known at compile-time) and strongly (these types are designed to make it harder to write incorrect programs), Rust will be perfect for “Hardcore”, such as operating systems, device drivers, and embedded systems that might not even have an operating system. However, it’s a very adorable programming language to write standard or web application code.

Rust makes the best possible machine code with complete control of memory and data. Rust checks all memory and data type accesses. It is almost impossible to corrupt memory by accident. With strictly enforcing safe borrowing of data, it makes Rust code “Beautiful.”

Let’s Get Started with Newbie’s Tradition, Hello World…

First, environment...

As usual, we do need to set up an environment for Rust. We’ll download Rust through rustup, a command-line tool for managing Rust versions and associated tools.

On Linux or macOS, we can install it by open terminal and enter the following command:

$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

For Windows, go here and follow the instructions for installation.

We’ll need the C++ build tools for Visual Studio 2013 or later. The easiest way to acquire the build tools is to install Build Tools for Visual Studio 2019.

Coding Time !!

Rust files always end with the .rs extension. If you want to use more than one word for your filename, you can use an underscore to separate them. For example, hello_world.rs. For now, let’s name it with main.rs.

The basic structure of Rust code is :

fn main() {
println!("Hello, world!");
}

The code above is a main function. The main function is special. As like C/C++, it’s the function that will be called for every executable Rust program. The first line declares a function named main that has no parameters and returns nothing.

Inside the main function, we have println!("Hello, World");. The println!is called a Rust macro, which is how meta-programming is done in Rust (For further explanation please wait for the next month's blog...). Basically with println!, Rust will print the argument inside, "Hello, World". The line ends with a semicolon (;). The ; indicates that this expression is over.

Finish it !!!

Save the code, and go back to your terminal window. On Linux or macOS, enter the following commands:

$ rustc main.rs
$ ./main
Hello, world!

If you are Windows team, use .\main.exe instead of ./main.

> rustc main.rs
> .\main.exe
Hello, world!

If you did see Hello, world!, then congratulations! You’ve finished the Newbie’s Tradition~ Now you have officially become Rust programmer! Welcome!!!

If you want to explore other cool blogs of technologies, please stay tune on eCloudture Medium !!!

--

--

Geoffrey Aaron
eCloudture

He is passionate about making the world a better place. He wants to solve business and economic with the latest technology.