DEV Community

Cover image for Why is Rust the most loved programming language in the world?
Pedro Aravena for Vaultree

Posted on • Updated on

Why is Rust the most loved programming language in the world?

Recently, Stack Overflow published the results of the 2020 survey on the programming area, using the data provided by 65,000 developers from all around the world, and you must wonder why such an unknown language was at the top, surpassing even Typescript, Kotlin and Python, which are well loved by their audience and also very famous.

Image description

To understand why 86.1% of developers using Rust love the language, we first need to understand its origin:

Rust started as a personal project by Mozilla employee Graydon Hoare in 2006, the project was sponsored by the company in 2009 and had its first version (1.0) in 2010.
“The language was designed to help developers create fast and secure applications that want to take full advantage of the powerful features of modern multi-core processors. It prevents segmentation faults and ensures thread safety, all through an easy-to-learn syntax.
In addition, Rust offers zero-cost abstractions, semantic changes, guaranteed memory safety, threads without race conditions, trait-based generics, pattern matching, type inference, and efficient binding to C, with the smallest size at runtime.”

https://developer.mozilla.org/pt-BR/docs/Mozilla/Rust

As many tech companies say, it is very difficult to write secure code for critical things like engines and kernels, which are usually written in C/C++ for controlling low-level concerns and performance. Problems such as memory leaks and exceptions due to pointer problems or even security problems such as improper access to memory addresses often occur.
Rust fills these gaps, offering control and security for the application without sacrificing performance, and it was exactly for this reason that Microsoft decided to adopt the language to use in its products and services. (See article).
Not only did Microsoft realize that investing in this new technology would be a good idea, but Linus Torvalds also discusses including Rust in some Linux modules (Read this article).

Discord itself uses Rust in production to solve problems with frequent CPU usage spikes when triggering the Garbage Collector (Read this article).

Recently, several big techs like Google, Microsoft, Mozilla and Amazon jointly launched a non-profit organization to help the language maintain itself by giving full support to the maintainers who lead and develop the project.
Here at Vaultree we use Rust in our product and services, as we need to deliver data with reliability and agility to our customers, as we are in a business line where any error or inaccuracy can be costly, the adoption of Rust was a great fit for us.

Image description

So, we talked a lot about how Rust was a fit for us, but, what are some of its main features?
Rust contains some features that make it different from languages ​​similar to it, such as C or C++. Check out the main ones below!

Performance

Many programming languages ​​use a garbage collector, also called Garbage Collector. It is a mechanism that frees the memory allocated by variables that are no longer in use. Rust handles much of the memory management during the build process. That way, you don't need an extra component to perform this activity.

This feature guarantees more speed to the application, as it does not need a runtime along with the executable object. In this way, there is a performance gain. Therefore, one of the applications in Rust is for the development of libraries that can be accessed by different types of languages ​​through interfaces, including web applications.

Reliability

The Rust compiler is extremely efficient. It is capable of detecting different programming errors that may interfere with the application's operation. In addition, Rust has a runtime memory management system. This means that whenever a variable is no longer used by the application, it is automatically eliminated.

This feature allows faster access to memory during application execution. In addition, it guarantees that there is no invalid memory state, that is, there are no null pointers or alone, which would cause memory segmentation faults.

Productivity

Rust has a super smart compiler. Therefore, it can identify programming errors that may go unnoticed in other languages. It also has extensive documentation, rich in details, explanations and examples on how to use the language.

It also offers intelligent support and compilation tools, which can be integrated into many available code editors. All these features help to increase the productivity of programmers.

Image description

See how Rust language is an excellent alternative for applications that need good memory and speed management? In addition, it is a versatile tool, as it can be used both for the development of low-level systems and web applications.

Happy coding!

At Vaultree we are building an encrypted future. We love sharing valuable information and trends to help you keep your data safe. Sign up to stay in the loop and discuss the hottest trends in cybersecurity with a team of experts.

Image description

Discussion (9)

Collapse
pyrsmk profile image
Aurélien Delogu

Agreed to all of that. But it has the worst learning curve I have ever seen and I would never push the idea to do something in Rust in my company unless we need strong and stable performance.

Sadly, you only become productive in Rust after several months of constant coding.

Collapse
thedenisnikulin profile image
Denis

This is actually the tradeoff cost you have to pay for the performance and safety. The learning curve starts to seem reasonable compared to Rust's closest opponents like C++. Try using C++ for your next project and you will never become productive even after several months, and you also won't even have any strong safety guarantees with it

Collapse
guithomas profile image
Guilherme Thomas

Indeed. I recently started learning Rust as a second language, coming from Java, and I can't stop hitting walls. But still, I know it will payoff.

Collapse
natescode profile image
Nathan Hedglin

Yes, that's the cost for that level of safety and performance.

Collapse
deadlock profile image
Satyajit Roy • Edited on

I certain feel the style and ideology behind the Rust is very cool. I totally get that the learning curve with Rust is very steep. However I found it really worth it. I was basic python guy back in the days. Then migrated to Golang big time and after that looking into Rust and learning that was real eye opener.
In my experience the only way I could learn a language is to write something in it. So I started writing small tools, which are required in personal front and in work too. That gave me a nice boost towards my learning.

Collapse
ayodejii profile image
Isaac Ayodeji Ikusika

I do not know if I should agree with this.
Some months ago I picked up Rust and it seemed too complex.
My background is C#.
Maybe one day I'll get it right, but all I can say about that language is it is too complex.

Collapse
thedenisnikulin profile image
Denis

Yes it's quite complex language, but the complexity comes from a reason. To better understand why Rust is this complex try learning something like C language, and it would be much clearer for you why Rust is designed this way

Collapse
polterguy profile image
Thomas Hansen

Rust is probably amazing. However, the reason why people love it is because they tend to come from C++, which of course is garbage insanity defined. When you realize you can drop C++ and use Rust, it seems a hundred times better than what it actually is. Just my 2 cents …

Collapse
jmfayard profile image
Jean-Michel Fayard 🇫🇷🇩🇪🇬🇧🇪🇸🇨🇴 • Edited on

I think that's right: the C++ devs were used to sacrifice everything that make our jobs simpler, clearer and safer in the name of peak performance. Then they hear there is a language that offer peak performance as well. They finally accept to switch and discover what they had been missing all along from modern programming languages.