News

Native Rust in Visual Studio Is Top Dev Request, but Progress Slow

The top open item for Visual Studio on Microsoft's Developer Community feedback site asks for native Rust support, but the company has taken little action on the years-old request.

Rust popularity has grown substantially over the years as developers have become increasingly enamored of characteristics such as performance, concurrency, productivity, a vibrant community/ecosystem -- and especially security, as it provides a memory-safe alternative to C and C++ code.

Why Rust?
[Click on image for larger view.] Why Rust? (source: rust-lang.org).

Microsoft has been enthralled with Rust for an equal number of years, seeing it gain traction in the .NET community and even investigating using the language as a replacement for C++ and its memory bugs since at least 2019, which is when the Developer Community request was made.

Languages of Most Interest
[Click on image for larger view.] Languages of Most Interest (2021) (source: .NET Foundation).

The request reads:

Could the Visual Studio / Visual Studio for Mac team please consider adding native Rust support. It would be great to be able to:
  1. Create a Rust project / solution within Visual Studio
  2. Debug Rust projects
  3. Intellisense / Intellicode support for Rust
  4. Cargo Package Management support for Rust
  5. Azure DevOps / Pipelines etc. support for Rust
  6. Publish Rust libraries to Cargo via Azure Pipelines CI / CD
While there are extensions that can partially do the above, the above items would allow first class Rust development within Visual Studio.

It's the top open request ("Under Review") when the feedback items are sorted by relevance or most votes (except for the longstanding 2018 request for "Visual Studio for Linux,", which is inexplicably marked "New"). It has garnered 452 votes and 42 comments.

However, the dev team has apparently done little with the request since it was marked "Under Review" by a bot in October 2020. The last published comment from a developer came in July.

Which doesn't mean it won't eventually be placed "On Roadmap," as Microsoft takes great pains to solicit feedback to help guide the development of its tooling and often implements new features years after they were proposed as it needs to sort through the thousands of feedback items it constantly receives. For example, the top "On Roadmap" item ("Full Git submodule support") was posted in 2018. The big features may come slowly, but the most important ones usually do come.

In the meantime, after its memory-safe explorations as a possible alternative to Microsoft's vast amount of C++ code in its products, Microsoft has been using Rust more and more.

Just a couple months ago, for example, Microsoft announced a remake of the Azure Quantum Dev Kit with Rust, making it able to run in a browser thanks to Rust being compiled to WebAssembly code.

A couple years ago, the company opened up old Win32 APIs built with C/C++ to Rust (and C#). That led to Microsoft in 2021 announcing "Rust for Windows Achieves Full Consumption (Call any Windows API)."

While Microsoft's embrace of Rust as a language with native support in its flagship Visual Studio IDE, the same can't be said for the Visual Studio Code team, which last year made the language of new "topic" that describes Rust programming language support in VS Code with the rust-analyzer extension (2.5 million installs).

"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."

The Rust VS Code Topic
[Click on image for larger view.] The Rust VS Code Topic (source: Microsoft).

The affinity with the open source, cross-platform VS Code editor was further illustrated when a 2021 survey deemed VS Code to be the No. 1 editor used by Rust developers.

Top Editors
[Click on image for larger view.] Top Editors (2021) (source: Rust Team).

Beyond the VS Code camp, Rust also emerged many years ago as the new darling languages of programmers, who consistently named it the "Most Loved" or "Most Desired" programming language in Stack Overflow surveys, (see the 2020 article, "So What's Up with Microsoft's (and Everyone Else's) Love of Rust?").

Most Loved Programming Languages
[Click on image for larger view.] Most Loved Programming Languages (2020) (source: Stack Overflow).

The answer to the question in the above headline might be answered by a recent post from Microsoft-owned GitHub titled, "Why Rust is the most admired language among developers."

Still, it remains to be seen what action the dev team will take on the request for native Rust support in Visual Studio in response to comments such as this one posted last December:

My support for Rust here! From someone here also being a C# developer for ages, but who likes to explore many programming languages.

I can say Rust is a very great one to learn and use and feels really like a language of the future, technologically far onward compared to many aspects of the older languages like C and C++, and even better designed in certain ways than C# (omitting the fact that C# and Rust languages have quite different uses and therefore aren't really competitors).

I have read that Microsoft is one of the supporting companies of the Rust programming language. So from that perspective I see no issue to add the language to VS.

But if they do it, it has to be done in a serious way in my opinion. Otherwise they better leave it. Other languages have been adopted in VS as well, like Python for example, but the VS Code experience is still better as far I have seen.

In the case of Rust the experience in VS Code is already very great. And usable on Linux, which is - sadly - still not an option with VS. Move improvements on the VS Code side are always welcome as well.

A sign that more action may be taken soon came last year in a social media post from Microsoft's Mark Russinovich, CTO of Microsoft Azure, wherein he called to halt starting any new projects in C/C++ and use Rust for scenarios where a non-GC (garbage collection) language is required.

Mark Russinovich Post
[Click on image for larger view.] Mark Russinovich Post (source: X).

And, in April, a Reddit thread discussed Microsoft rewriting core Windows libraries in Rust, revealed by David Weston, director of OS security for Windows, at an event in Israel.

More recently, in July, RedmondMag reported: "The Canary Channel release (build 25905) of Windows 11 notably is adding Rust language support in the Windows kernel for some testers. 'Rust offers advantages in reliability and security over traditional programs written in C/C++,'" Microsoft noted."

To help developers get started with Microsoft's embrace of Rust (and possible future native support in Visual Studio), Microsoft has published several learning resources, including:

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube