Let’s talk about Rust today. Rust is one of those technologies which is emerging, it’s super hot right now, but still, a lot of people don’t exactly know why it is what it is today. We going to spend some time with Rust because it is the technology that will shape the future of web development and it’s an awesome programming language as well. So let’s go ahead and spend some time with Rust in this article.
What is Rust?
Let’s start from the very starting what exactly is Rust? So if you are not living under a rock, you know that Rust is a programming language, which is just like any other programming language, allows you to program computers. It’s not a front-end language which means you cannot use it in front-end web development or things like that. It’s like a back-end development language or a programming language like you have PHP or Java or Python for example. But this has a twist because Rust performs very close to in performance with C and C++, which is the best you get on computers. But at the same time, it’s also a very important pain point of C, C++ developers that is memory management.
So how exactly does Rust do this memory management? We will not go into details of that obviously because that will get complicated and technical, but what you have to realize is Rust uses a unique practice or a unique architecture where Rust tries to enforce a lot of important memory management rules at compile time itself.
So at compile-time, you get the benefits of all the memory management things which you get on higher-level programming languages, but what happens in Rust is that you get that security layer on compilation itself instead of runtime. I mean on runtime, obviously, you have certain checks, but you don’t want a lot of checks on runtime because that decreases your performance and if you want to keep performance as similar to C and C++, you want checks for developer experience on compile-time, but you don’t want a lot of checks of a lot of things on runtime.
So currently if we talk about Rust as a programming language, almost all big players use it in one way or another. AWS uses it, Cloudflare uses it. And a lot of tooling also uses it. For example, Next.JS has started using Rust a little bit.
Rust is way faster
The only thing is Rust is way faster, maybe 10 to 100 times faster for some operations when you implement certain things in Rust. Now the situation is in the case of web development we anyway need to get this .JS File out, so this is what ships to the client. This is something that we cannot change that is done and dusted right until we also ship some WASM or something where we can optimize still is this whole pipeline of developer experience that the developer is facing.
But that’s again just like saying how you know this whole thing works. So the point here is that you as the developer, you as a web developer today, don’t and won’t really need Rust to need to learn Rust for working on this layer on the very front, but the moment you go back into building experiences for developers. Today, if you are working on Webpack for example, or today if you are working on SWC or the Terser plugin or whatever plugin, if you know Rust it will be a game-changer for you because you can directly jump into these companies, help them build these projects, help them build these libraries and ship it out, probably 10s of millions of developers in the next few years which will use them as the fundamental underlying technologies to start their projects or start their startups.
Why Rust is important?
I hope you get something new to learn from this article today. If you do then please tell me in the comment section and share it as much as you can!!