What is Rust and how to use it on Linux

Rust installation script

A few days ago Darkcrizt He told us what programming languages ​​were used to write the code of Android 13. And, one of them is the one that is occupying more and more prominence in the creation of the Linux kernel. That is why in this article we are going to explain what Rust is and how to use it on Linux.

The curious thing about the case is that in the list of most popular languages ​​according to the TIOBE index it is last in 20th place while the C and C++ it is replacing are second and third. However, it looks like he's going to have a great future.

One might ask what then is the need for a new programming language. The answer is that around 70% of the security problems experienced by Microsoft products and Google Chrome in the last decade have to do with flaws in the programming languages ​​mentioned above.

what is rust

Originally developed by Mozilla, it is now in the hands of ato independent foundation. SThe objective was to create a language with the characteristics of C and C++ but solving security problems of these languages. Hence, it has aroused the interest of operating system developers.

Also, its compiler is much more efficient and is ideal for processing large amounts of data.

To give a more formal definition we can say that Rust is an open source programming language. It is statically typed and intended to maximize performance and security with an emphasis on safe memory management and concurrency.. It has a syntax similar to that of C++.

Programming languages ​​handle various types of data that, in order to be processed correctly, must first be identified. For example, distinguish if it is a character or a number.

The process of verifying that each piece of data has been assigned to its correct type is known as type checking, and each programming language has a system for doing this as it helps prevent errors during program execution. The check can be done at runtime or when compiled.

In statically typed programming languages ​​like Rust the check occurs at compile time. Compilation is the process of converting program code into a machine understandable language. This requires knowing the type associated with each of the variables.

Concurrent programming allows different parts of the code to be executed alternately but so quickly that the user thinks it is being done in parallel.. This allows, for example, that if a part of the program requires an external response (for example, the connection with an external server) the rest of the program continues to run. It could be the case of an email client that, while waiting to be able to download email from one account, sends ours through another.

How to install Rust on Linux

Now that we know what Rust is, let's see how we can install it in our Linux distribution. To do this we open the terminal and write the following command

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
You may need to install the curl command first. It's in the repositories of all distributions so use the usual command.
When we execute the command we will see the following message:

Welcome to Rust!

This will download and install the official compiler for the Rust programming language, and its package manager, Cargo.

Then it tells us the directories it will use and offers us three options:

  1. Continue with the installation (Default option)
  2. customize installation)
  3. Leave the facility.

If we select the first option, when the installation is finished it will ask us to close the terminal to update the configuration. We can also do it with the command:

source "$HOME/.cargo/env"
We check the Rust version with:
rustup update
And uninstall with:
rustup self uninstall
How integrated development environments can be used Visual Studio Code (It is in the Snap and Flatpak stores) and GNU Emacs (Official Repositories).
I didn't want to get too into the technical differences between Rust and other programming languages. Just pointing out that if you want to learn programming and even help with Linux development, Rust seems like a great option.


Be the first to comment

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.