Linux is made in C, but Linus Torvalds already talks about using the Rust language – Tecnoblog

At best deals,
no tail tied

the programming language Rust emerged in 2010 with the proposal to be safe and practical. These are important aspects. Even so, no one expected that Rust could be taken to one of the most important software projects of all time: the Linux. Linus Torvalds already talks about adopting the language in the kernel.

Linux
Linux (image: Vitor Padua/Tecnoblog)

For now, this is not a promise, but a possibility. A possibility with a good chance of becoming real, however. That’s because, at the end of 2021, Rust became officially supported on Linux (at the kernel level).

In other words, an update implemented at the time paved the way for Rust to be used in the project as a “second language”. The main one remains the C language.

With 50 years of existence, C has been the basis of Linux since the project began, in the early 1990s. And every experienced programmer knows that this is a language endowed with many qualities: efficiency, structured syntax, requirement of few hardware and so on.

If so, why change?

At the Open Source Summit event held by the Linux Foundation last week, Linus Torvalds admitted to expecting Rust to be used in the kernel. This could start with version 5.20, to be released next October or November. Developers are currently working on version 5.19, which should be released in August.

Whether in Linux 5.20 or not, this isn’t going to be a “from now on, we’ll only program in Rust” change. The idea is that the language is adopted in specific parts of the kernel, so that it is not necessary to rewrite all the code.

Also because rewriting Linux would be counterproductive. The project’s source code is around 30 million lines long. The language should be used, above all, in components to be updated or not yet existing, such as new APIs.

It’s not just a whim. During the event, Torvalds highlighted that there are technical reasons for using Rust, such as memory security. Presumably, the language will also streamline development work.

The Rust programming language

A report published in May by analytics firm SlashData shows that Rust is among the most popular programming languages ​​today.

The survey shows that, in the last two years, the number of developers of this language, on a global scale, jumped from 600 thousand to 2.2 million people. The trend is that this number will continue to increase in the coming months.

could. Rust is multi-paradigm, meaning it can work and solve problems in many ways. This makes the language interesting for the development of various types of software, including operating systems.

It is not by chance that Rust already finds space in projects from companies such as Microsoft, Cloudflare and Amazon.

Linus Torvalds did not exaggerate in stressing the security aspect. In addition to having a very efficient memory management, the language is capable of preventing the improper insertion of data in RAM, for example, a problem that is usually exploited in malicious actions.

Other advantages include reliability, relatively easy integration with other languages ​​(including C), fast debugging, relatively easy code reuse, extensive documentation, and an engaged community.

It is true that learning to program in Rust is not an easy task. On the other hand, those who know languages ​​like C and C++ tend to get familiar with Rust fairly quickly.

Linus Torvalds (image: Krd/Wikimedia)
Linus Torvalds (image: Krd/Wikimedia)

Torvalds wants to avoid high expectations

The idea of ​​bringing Rust to Linux is not new. To give you an idea, last year, Google started to support a project that foresees the change of some parts of the kernel to this language.

As Linux is the foundation of Android, Google believes that this change can increase the security of the operating system. But the conversations about language began earlier. In April 2021, Torvalds himself suggested that Rust could start its trajectory on Linux from version 5.14 (which did not happen).

As one of the main maintainers of the kernel, Linus Torvalds has expressed a desire for Rust to be permanently integrated into Linux from version 5.20 onwards, but made it clear that it’s okay if it doesn’t: “I’m not going to force it. (…) This would basically be the starting point. So no promises.”

What seems certain is that, if not now, Rust adoption will happen at some point. Another speech by Torvalds reinforces this possibility:

We tried C++ [no kernel] for over 25 years. We tried for two weeks and then stopped trying. So for me Rust is a way to try something new. And I hope it works. There are people working a lot on this, so I really hope it works out, otherwise they would be upset.

With information: ZDNet, The Register.

Source link

About Admin

Check Also

How to leave someone ‘in a vacuum’ on WhatsApp | Social networks

Leaving someone “in a vacuum” on WhatsApp can be the best way out in different …

Leave a Reply

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