BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage Articles Rust Reviewed: the Current Trends and Pitfalls of the Ecosystem

Rust Reviewed: the Current Trends and Pitfalls of the Ecosystem

This item in japanese

Bookmarks

Key Takeaways

  • The Rust community is expanding, and the usage of Rust is on the rise.
  • Rust seamlessly integrates with other programming languages in codebases, making it an excellent choice for mixed-language projects.
  • Although relatively young, Rust developers possess professional experience in other programming languages.
  • While the Rust ecosystem and tooling may have some drawbacks, there has been significant progress.
  • Rust is widely regarded in the community as a language that delivers on its promises of memory safety and performance.

The Rust ecosystem is regularly explored in numerous developer surveys. Carefully reading these reports can yield insights into the community and the potential of the technology. For example, most Rust developers got started with the language only recently, which may be a sign that employers should review their job descriptions and stop expecting 10 years of Rust experience.

The community is growing rapidly. Adoption in the industry is slightly behind, but tech giants are already paving the way. We can also identify weak areas in the tooling, mainly in profiling and debugging support, related to the prevalence of naive techniques in these areas.

In this article, we share findings and insights about the Rust community and ecosystem and elaborate on the peculiarities and pitfalls of starting new projects with Rust or migrating to Rust from other languages.

Rustaceans

How many Rust developers (or Rustaceans, as they call themselves) are there out there? Although counting developers is not an exact science, we have some estimates. In its 23rd State of the Developer Nation report (Q3 2022), SlashData estimates the number of Rust developers to be 2.8 million, which is 1/7 the size of the JavaScript community and less than 1/4 of the C/C++ community.

The same survey reports that this number has tripled over the last two years, making it one of the fastest-growing developer communities. Is there any potential for growth left?

According to the Stack Overflow 2022 Developer Survey, 17.6% of developers who don’t use Rust want to use it, which makes Rust the most wanted language among the developer community. Given current trends and the relatively young age of the technology, the future looks bright.

The Rust community is young. According to the State of Developer Ecosystem 2022 report by JetBrains, 60% of developers who mentioned Rust as their primary language are under 30.

The 2021 State of Rust Survey by the Rust Team reports that half of the developers have less than 10 years of programming experience in any programming language.

Let’s also look at the background programming experience Rust developers have. The State of Rust Survey identifies the following large (possibly intersecting) groups of Rust developers with respect to other programming languages used:

  • 41% of Rust developers consider themselves experts in dynamically typed languages (JavaScript, Python, PHP, etc.).
  • 27% consider themselves experts in statically typed object-oriented languages with garbage collection (Java, C#, Go, etc.).
  • 20% consider themselves experts in languages with manual memory management (C, C++, etc.).

The Stack Overflow Survey also reports significant numbers of JavaScript, TypeScript, Python, Java, and C++ developers interested in working with Rust. Interestingly, C developers are not that inclined toward Rust, although this may change given the recent changes in Linux policies about kernel development and the trend of supporting Rust in other major C-based projects (for example, curl).

According to the Rust section of the State of Developer Ecosystem 2022, only 5% of Rust developers have been using the language for more than 3 years. About half of Rust projects are purely Rust projects, while others share their codebases with JavaScript/TypeScript (22%), Python (15%), C++ (12%), Go (12%), C (11%), and other languages. A GitHub search for popular repositories with Rust as a primary language reveals that 20% of them also contain code in Python, with another 20% containing JavaScript.

Based on this data and my observations of the Rust community, I suspect that it is growing thanks to the huge number of young people with Python and JavaScript backgrounds who are moving to their first systems programming language. Such languages are much harder to learn but introduce them to a whole new experience in software development. Older languages like C and C++ are not that appealing to them, but Rust is.

Technology Domains and Industry Adoption

The Rust Team’s survey reveals that server-side (backend) projects are the primary technology domain for Rust. Cloud computing infrastructure and applications is another huge area for applying Rust, while distributed applications are also a popular choice among the Rust community.

Linux is the most targeted platform (77% vs. about 41% for Windows and 36% for macOS). WebAssembly is at 22%, while embedded systems are only targeted by 11% of Rust developers. Rust’s usage for mobile applications is mostly negligible.

CLI tools are much more popular than GUI applications for Rust projects. This can be attributed to the predominant supply of CLI libraries in the ecosystem, while GUI libraries are less common. According to the State of Developer Ecosystem 2022 survey, 46% of Rust developers use it for developing CLI tools.

There is a technology area that may not be easily visible simply from looking at the numbers, though it is extremely important for showcasing Rust applications: tooling for other programming languages. We can see that Rust is used both in the JavaScript and Python communities for developing high-performance alternatives to the current tooling available for those languages. Projects like deno (a JavaScript and TypeScript runtime) and Ruff (a Python linter) are good examples of this trend. These open-source projects show that Rust provides both high performance and pace of development while also attracting a lot of contributors. There is a long-standing tradition of developing tooling for a programming language using that language. Rust breaks from this tradition quite effectively.

Tech giants like Microsoft, Google, Amazon, and Meta endorse and support Rust. Still, the State of Developer Ecosystem 2022 survey reports that most Rust developers use Rust outside their jobs. Only 18% of respondents develop software in Rust as part of their official work. Less than half of the respondents of the Rust Team’s survey consider themselves productive in Rust. Less than half of the respondents of the same survey use Rust daily or so. These numbers suggest that others are still learning it or use it occasionally as a hobby for personal projects.

Job postings on various websites don’t allow us to conclude that there are thousands of mid-size or small companies interested in hiring Rust developers. Only 15% of the Rust Team’s survey respondents reported that their company uses Rust for a large number of projects, while another 18.5% saw it being used in a small number of projects. It seems that the main way to introduce Rust in a company is by rewriting non-critical components from other languages or starting a new non-essential project in Rust to measure its effectiveness. The Rust community is actively discussing both success stories and failures regarding the process of transitioning to Rust or launching new projects.

Starting a Rust journey requires a company to have some senior engineers with long-time Rust experience who can supervise the transition. As we’ve already highlighted, there is a shortage of such sort of developers in the community. Fortunately, this is something that is going to be fixed automatically as time goes on.

The 2021 State of Rust Survey identifies Rust's lack of usage in the industry as the number one concern. The situation is, however, expected to change.

Language and Tooling

One big thing about Rust is that it delivers on its promises. Being memory safe allows for the elimination of certain classes of bugs. Google partially attributes the decline of critical vulnerability numbers in Android to the adoption of Rust as a memory-safe alternative to C++. Rust performance allows Amazon to be sustainable in terms of energy efficiency. Both reduced CPU usage and effective memory management are outcomes of Rust language features.

70% of developers using Rust at work strongly agree that Rust’s performance characteristics (such as speed, memory footprint, and others) influence its adoption. 64% of them value Rust security and safety features. About 80% of them agree that Rust allows them to achieve their goals and pays off the cost of adoption. 65% of developers consider Rust language and standard library documentation to be great. These numbers explain why Rust is in its seventh year as the most loved language, with 87% of developers saying they want to continue using it according to the Stack Overflow survey. Rustaceans are loyal to Rust, which says more about the language and its quality than it does about the developers themselves.

38% of Rust Team’s survey participants agree that Rust is significantly more complicated to program in than other programming languages. 62% agree that it requires significantly more effort to learn. They also worry that it is becoming even more complex. This was the second most common concern about Rust’s future among the survey participants.

All the surveys agree that Visual Studio Code powered by rust-analyzer is the most popular IDE for writing in Rust. It is used by about half of Rust developers. The share of the runner-up, JetBrains IDEs (CLion, IntelliJ IDEA, and others) powered by our IntelliJ Rust plugin, varies from 25% to 40% depending on the survey. Vim/Neovim is the third most popular option. Two-thirds of Rust developers consider their IDE experience great or good enough.

When going into the details of the development experience, the surveys reveal that the most problematic parts are debugging and profiling. 32% of the State of Developer Ecosystem 2022 survey participants mention that they miss a native debugging experience. 29% of the Rust Team’s survey respondents believe the debugging experience could be better. More than half of Rust developers use println-style debugging as their main way to debug issues with their code, and one-third of them use that approach exclusively.

The code profiling experience is even worse; more than 80% of Rust developers don’t use profiling tools at all. One reason may be that the tools currently available are very difficult to use and their findings are hard to interpret. Teaching materials focused on profiling are mostly absent. It seems developers are happy to blindly believe in Rust performance without actually checking it. This attitude could become a critical problem with the growing adoption of Rust in the industry. Profiling tools themselves and learning materials both require serious efforts to improve.

Unfortunately, the available surveys don’t go into Rust libraries. We don’t have good data on the parts missing from the library ecosystem. Being a young technology entails issues with technological completeness, though given Rust good interoperability this is never seen as a critical problem.

Conclusions

As is often the case with surveys, these results both back some interesting conclusions and undermine some prominent theories. In an example of the latter case, these results suggest that the original perception of Rust as a C/C++ killer doesn’t seem relevant today. We don’t have evidence of a massive replacement of C/C++ code in the existing codebases, nor do we expect that to happen in the future. Why? Well, because both C and C++ continue to work. C++ is evolving, and long-standing problems are being solved. It simply isn’t necessary to rewrite everything in Rust. Additionally, there is not enough workforce to do it. Nevertheless, starting a new project in C or C++ nowadays requires careful consideration. Rust might be a good choice for that project too, especially if the target platform is Linux and you care about performance and safety.

The young age of community members indicates that Rust has a bright future. It is not going anywhere, and adoption in the industry will continue to rise. As the number of experienced Rust developers grows, we’ll see more pure Rust projects emerge. Tech giants are already in the Rust boat, and we expect small and mid-sized companies to follow suit soon.

Tooling for Rust is constantly evolving, with many enthusiasts and companies around the world contributing to the tooling ecosystem.

Being productive in Rust requires a deep understanding of its concepts, especially in the areas of ownership, memory management, and approaches to concurrency. Programming efficiently in Rust requires dedicated learning and training. This is why the common practice of having developers skilled in other programming languages to switch to Rust could be more problematic than for other languages. Switching from any language requires changing a lot of habits. Don’t expect developers to master those concepts and acquire new habits quickly by themselves; instead, educate and train them beforehand.

About the Author

Rate this Article

Adoption
Style

BT