Visual Studio Code Nods to Rapidly Rising Rust Language
Rust, one of the fastest-growing programming languages, is the subject of a new Visual Studio Code topic.
Announced in the latest update to VS Code (the April 2022 update bringing it to v1.67), the new Rust in Visual Studio Code topic describes Rust programming language support in VS Code with the rust-analyzer extension.
"Rust is a powerful programming language, often used for systems programming where performance and correctness are high priorities," reads the new topic. "If you are new to Rust and want to learn more, The Rust Programming Language online book is a great place to start. This topic goes into detail about setting up and using Rust within Visual Studio Code, with the rust-analyzer extension."
Specifically, the new topic covers everything from installation to a Hello World example to IntelliSense, refactoring, debugging and more.
VS Code's nod to Rust makes sense, as a survey conducted by the Rust community itself demonstrated the affinity between the two, as described in the 2020 article "Rust Survey: VS Code is No. 1 Editor."
The new topic comes amid a years-long rise in Rust popularity. For example, Rust made a big splash in the .NET-centric developer community several years ago when we reported "C++ Memory Bugs Prompt Microsoft to Eye Rust Instead." That article referenced posts from the Microsoft Security Response Center (MSRC) titled "A proactive approach to more secure code" along with "We need a safer systems programming language" and "Why Rust for safe systems programming."
"We believe Rust changes the game when it comes to writing safe systems software," the MSRC said. "Rust provides the performance and control needed to write low-level systems, while empowering software developers to write robust, secure programs."
There doesn't seem to have been much progress since then on adopting Rust as a C++ replacement for systems programming, but Microsoft, which joined the Rust Foundation last year, posted documentation in February titled "Overview of developing on Windows with Rust." Microsoft has also spearheaded Project Verona on GitHub, described as "a research project being run by Microsoft Research with academic collaborators at Imperial College London. We are exploring research around language and runtime design for safe scalable memory management and compartmentalization. The prototype here only covers the memory management aspects of the research."
Also, one of those MSRC 2019 posts noted that Rust topped Stack Overflow's list of most loved languages for four years running, and its ascent continues today.
For example, Slashdata's 22nd edition of the State of the Developer Nation report published early this month noted that the Rust community has nearly tripled in size in the past 24 months.
"In the previous edition of this report, we had identified Rust as the fastest growing language community," Slashdata said. "This continues to be the case as of the beginning of 2022, with Rust having nearly tripled in size in the past 24 months, from just 0.6M developers in Q1 2020 to 2.2M in Q1 2022. It also moved from 14th to 12th place in the ranking of programming languages in just six months. Rust has formed a very strong community of developers who care about performance, memory safety, and security. As a result, it is mostly used in IoT software projects but also in AR/VR development, most commonly for implementing the low-level core logic of AR/VR applications."
Nevertheless, that 12th place is still pretty far down the list. The Slashdata survey says Rust is most popular for augmented reality/virtual reality, IoT and apps for third-party ecosystems, while being least popular for web and mobile:
As far as the rust-analyzer extension for VS Code, its features include:
- code completion with imports insertion
- go to definition, implementation, type definition
- find all references, workspace symbol search, symbol renaming
- types and documentation on hover
- inlay hints for types and parameter names
- semantic syntax highlighting
- a lot of assists (code actions)
- apply suggestions from errors
It has been installed more than 587,000 times, earning an average 4.9 rating (scale 0-5) from 157 developers who reviewed it.
"Best LSP I ever used," reads one comment from February. "Really helps in coding. And it is now officially a part of the wider Rust organization. It keeps improving everyday."
David Ramel is an editor and writer for Converge360.