What Rust Brings to Frontend and Web Development

The year 2022 may well have been the year of Rust, with its introduction into the Linux Kernel. But should frontend/web developers concern themselves with this popular language in 2023?

It depends on what you need to do. Rust’s more likely to sub out for C/C++ than JavaScript, but if you need an application that starts and runs quickly, Rust might be just the ticket. It can also be coupled with WebAssembly to deliver a fast, secure app at the edge, said Chris Gardner, Forrester analyst and research director.

What’s Rust’s Role in Frontend?

“Rust to WebAssembly is one of the most mature paths because there’s a lot of overlap between the communities,” Gardner told The New Stack. “A lot of people are interested in both Rust and WebAssembly at the same time.”

It’s not an either “Rust or JavaScript” or even “WebAssembly or JavaScript” situation, he said. It’s possible to blend WebAssembly with JavaScript.

“You’re going to see some people rewrite for WebAssembly, but you’re going to see some people take advantage of WebAssembly where appropriate, and then use JavaScript for connecting the various pieces under the hood, and maybe running portions of the application as necessary,” he said.

How it handles memory safety makes Rust a good language to learn, he added.

“It’s one of those things that it’s very easy to get into trouble, using like C to build out memory allocation and then ultimately, you have to deal with all the bugs and all the runtime errors that you could potentially get,” he said. “Rust’s very, very fast, memory efficient.”

‘A Lot of People Are Fond of It’

There’s a pretty simple reason to learn Rust: It’s new and people like it, Gardner added

“It’s pretty well documented that people like using the language,” he said. “It’s one of those situations where people appreciate leveraging it.”

Chris Siebenmann, a Unix systems administrator at the University of Toronto’s CS Labs, has a theory about that: Languages spread when developers like using the language to accomplish things that matter to them. Right now, that language is Rust.

“Rust is a wave of the future because a lot of people are fond of it and they are writing more and more things in Rust, and some of these things are things that matter to plenty of people,” Siebenmann wrote in 2021.“When people like a programming language, things get written in that language and some of them become widely used or popular (or both) … We saw this with Go in certain areas, and we’re seeing this with Rust.”

Rust is already found in many places you might not expect, he wrote.

“There’s Rust in your Python cryptography. There’s Rust in Curl … There’s Rust in your librsvg. There’s a lot of Rust in your Firefox. There are a growing number of command line tools written in Rust, including the excellent ripgrep. Someday there will probably be Rust in the Linux kernel. All of this is only growing with time, especially in the open source world.”

Interestingly, in December, he amended that to say Rust is “inevitable” because of its safety features.

Rust poll from Mastodon

Rust poll from Mastodon.

Rust repeatedly has been voted the most loved programming language by developers on Stack Overflow’s developer survey since 2015, and it remained there in this past year’s survey. Perhaps not coincidentally, Rust headed the top 10 programming languages to earn the highest salaries for 2020.

Can Rust Make Bugs ‘Impossible’?

Rust was created at Mozilla Research in 2010 as a more reliable, secure alternative to C++. The open source language is now maintained by the Rust Foundation. Rust is a “static multiparadigm, memory-efficient programming language” that’s built for speed, security, and performance, according to Pavan Belagatti, frequent contributor to The New Stack and a developer advocate at Harness.io. You’ll find it in game engines, file systems, websites and tools, operating systems, browser components, and more, he wrote.

Rust is used by some big-name companies, such as DropBox, Coursera, Microsoft and Firefox. For Microsoft, adoption was about the safety of Rust over C++.

“Companies like Microsoft are using Rust for the safety of their products,” Belagatti stated in the TNS article. “Microsoft is encouraging their developers to rewrite some of their components in Rust because they discovered that most of the security patches are fixes to memory-related bugs, and Rust would’ve been able to catch these bugs during the development phase. Microsoft believes that Rust can help make software bugs, particularly those leading to security vulnerabilities, impossible.”

You can install Rust via the Rust Foundation; it automatically detects your OS.

Group Created with Sketch.

Source link


Leave a Reply

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