Do you love Rust like I do?

Hello colleagues.

In fact, until a few months ago, I hated Rust and wondered only one question: why the hell did I even get involved with it? But today – today everything is different. And about this, I want to offer a few arguments to disassemble with him.

Hi’s fast. Of course, not in the sense of development and debugging (especially at first), but in terms of work. The code written in it is, in some respects, much faster than similar code written in other programming languages. I don’t mean to offend others religions language preferences (I’m sure you can easily prove that this is not the case). However, the tests offered to me showed that it is a little, but faster.

He is safe. This, however, is not entirely true, but if we take a conditional beginner who writes a program in C and a conditional beginner who writes a program in Rust, the chance that the second one will come out safer will be significantly higher. At the very least, a buffer overflow attack is almost guaranteed to fail (let’s not deny the existence of talents that, even where it is almost impossible, can lay a vulnerability).

He is unusual. I’m sure you’ve come across strange programming languages. Those that break the usual paradigm and make you think differently. For example, people who have been working with an object-oriented approach all their lives often get lost when they encounter functional programming, because. there is a different approach. Yes, you don’t even have to go far; a collision with an attempt to use OpenGL from the usual C ++, at some point, breaks all the patterns and only two questions hang in the air: “what …” and “why are you doing this to me.” This, of course, passes, but not immediately.

Sorry, got distracted. So, Rust will make you look at programming in a different way, that is, in a completely different way. It will force you to write code in a way that you have not written before, because all the old paradigms simply do not work. “Want to send a structure to a function and then work with it some more? Not on my shift!” This greatly develops the imagination.

From perfectly documented. No, I’m not being fair to Rust. He fabulous documented. You will find a separate book about almost any aspect of working with him, where they will chew everything from “a” to “z”. But, it is likely that you still will not understand, because. to understand this, it would be nice to read a few more books where something else is chewed. But in a few months, the brain will grow by a size, or even by all two!

He is inexhaustible. Yes, sometimes that’s how it feels to me. There are many ways to do what I just did, only in a different way; has its own std library and I can’t even imagine what it doesn’t have, because it feels like it has a little less than everything.

He is friendly. The compiler will always tell you where you made a mistake and even offer a solution on how to fix the problem, as well as add a link to the help. And sometimes his recommendation even works. But in general, a log of 30 errors per 3 lines of code, at some point, already ceases to frighten and even surprise.

It is supported and developed. It comes with its own package manager (like npm or pip) out of the box, as well as a package registry. Of the disadvantages – it is not always possible to get the source of the package or library being installed (correct if this is not the case).

It can be used for web. Through webassembly. This is exactly the reason why I contacted him. I tried to emulate mold growth, and the last – I tried to implement a parallax effect on it on a web page without resorting to js (if you’re interested, you can read about it here). wasm-pack allows you to build webassembly packages and embed them in your application. You can also do it with ecmascripten for C++, but, for some reason, C++ is not so interesting for me.

He makes you study. To begin with, you will be forced to figure out how the application memory is arranged, how compilers work approximately, and what happens “under the hood” when the source code is converted into a binary (of course, if you didn’t already know this). Not that it will help you much in writing this very code, but some things should be known simply in order to use them at the most unpredictable moment.

To be honest, I have a strong feeling that Rust is not for everyone (like any other technology). True, it is quite difficult to understand, especially at first and especially for those who did not really want to understand the subject area. And although it is already quite popular, I can’t say that it is being actively implemented in their developments (judging by the statistics on GitHub): nevertheless, the inertia in these matters is very large. It took Python nearly 20 years to gain acceptance and widespread adoption. I think Rust has every chance to repeat this path.

Similar Posts

Leave a Reply

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