The Myth of Rust Being Difficult to Learn

The Myth of Rust Being Difficult to Learn
The Myth of Rust Being Difficult to Learn

Organized by Noah

In recent years, the presence of Rust has been increasing, but its steep learning curve seems daunting. However, an internal survey by Google suggests that the notion of Rust being “difficult to learn” may just be a rumor.

Is Rust really hard to learn? Why does Google support Rust when it has Go? Recently, the frequently conflicting Rust leadership team has undergone a complete restructuring; what changes will this bring to the development of Rust? Let’s break it down below.

The Myth of Rust Being Difficult to Learn

Not Hard to Learn, But Newbies Beware

Google’s survey targeted over 1,000 software developers employed at Google, of which about 13% had experience with Rust, while most came from C/C++, Python, Java, Go, or Dart. The results show that Rust is not harder to learn than other programming languages.

The Rust language is praised for its high performance and safety guarantees that other system languages like C and C++ lack, but it is often heard that Rust has a high learning threshold, especially the understanding of unfamiliar concepts like ownership can be time-consuming.

According to the survey, the three major challenges for developers mastering Rust are: macros, ownership and borrowing, and asynchronous programming. Nevertheless, developers quickly grasped the language.

As shown in the chart below, about 27% of respondents are confident they can get started with Rust in 2-3 weeks, and over two-thirds of respondents indicated they could contribute to a Rust codebase in two months or less. Additionally, one-third of respondents reported that their coding efficiency in Rust after two months was on par with other languages.

The Myth of Rust Being Difficult to Learn

Image source: googleblog

The report states: “There is no data indicating any productivity loss with Rust compared to any other language.”

It is noteworthy that developers generally believe that Rust code has high quality. When asked if they believe Rust code is more correct than code written in other languages, over 85% of respondents expressed confidence.

The discussion about whether Rust is hard to learn has been a topic in major forums both domestically and internationally. Overall, it resonates with the saying, “Those who find it difficult don’t know it, and those who know it don’t find it difficult.” Some have faltered at the “entry stage,” claiming its syntax is counterintuitive, while others, like a user with C++ experience, described it as “not a high learning cost.”

The Myth of Rust Being Difficult to Learn

Image source: Zhihu

Of course, for programming novices or those without experience in other languages, Rust is certainly not the first choice. However, for developers with some programming experience, the key is whether they can abandon preconceived notions and are willing to try and embrace Rust‘s approach. After all, there has never been a perfect and all-powerful language, only languages that are suitable or not.

The Myth of Rust Being Difficult to Learn

Why Tech Giants Are Pushing Rust

According to Stack Overflow’s annual developer survey, Rust has ranked among the top 5 most popular programming languages globally for several years. Not only developers, but many large tech companies also favor Rust.

Due to its memory safety and multithreading capabilities, Rust is being widely adopted in the tech stacks of large companies. Google, Apple, Microsoft, and Meta have all adopted Rust in some form.

  • Google uses Rust for Android programming and has even open-sourced a comprehensive Rust course.

  • Apple uses Rust in many of its projects, including robotics, AR/VR engineering, cloud engineering, and video engineering.

  • Microsoft is a strong supporter of Rust, using it to reduce memory safety issues in Windows.

  • Meta not only joined the Rust Foundation but also designated Rust as one of the officially supported server-side programming languages.

The question arises: why are these large tech companies turning to Rust after investing resources in developing their own programming languages?

For example, Go, created by Google, is widely used in its products. Similarly, Swift, developed by Apple, is used to build applications for iOS and macOS. C#, developed by Microsoft, is also promoted internally, but the commonality among these companies is that despite having their own languages, they still found a need for Rust.

Fundamentally, Rust fills a very important niche for companies with large legacy codebases: modern low-level programming languages. Each language has its unique personality, and if two languages act in more or less the same way, we wouldn’t really need two different languages.

For example, Go and Rust. Both are popular, modern, and widely used languages, but specifically, their programming methods and applicable scenarios are entirely different. Senior software engineer Andrew Lader describes:

If you want better development efficiency, or if you have many different services to implement, or if your development team is large, Go is a great choice. Go offers top-notch concurrency capabilities, does not allow unsafe memory access (Rust does too), and does not force you to manage every detail. Go is efficient and powerful, preventing developers from getting bogged down, focusing on simplicity and uniformity.

On the other hand, if you need to squeeze every bit of performance, then you should choose Rust. Compared to Go, Rust is more like a competitor to C++. Just as powerful as C++, it also offers many pleasant improvements. Rust allows developers to have finer control over thread behavior, error handling, and variable lifetimes! Also, one of the purposes of Rust is to enable interoperability with C. Go can do this too, but it requires a lot of effort to achieve, which is not the focus of Go.

Thus, it can be seen that Go and Rust each have their strengths, as they target completely different use cases. Ultimately, whether to choose Go or Rust depends on which language is more suitable for you and your team’s actual situation.

The Myth of Rust Being Difficult to Learn

Ending the “Drama” Turmoil, Community Governance Begins a New Story

Whether in the developer community or in major tech companies, Rust is showing a rising trend that cannot be ignored. However, since the beginning of this year, some controversial news about Rust has occasionally appeared in the public eye.

In early June, we published an article titled “Indeed, Rust Has Forked!” which mentioned the chaotic governance within the Rust team and some intense “political struggles” unrelated to technology. The community was concerned about the Rust management team’s endless state of “chaotic disorder,” believing it could damage the reputation and development of the Rust language.

Various governance issues prompted the Rust team to begin internal restructuring. Recently, they announced major adjustments to their organizational structure.

Previously, the Rust project created several teams, including core, language, mod, library, and cargo. The core team mainly supervised the issues arising in other Rust teams. However, as time passed, the core team held the highest decision-making power over Rust language dynamics and was not supervised by other teams, leading to disorder.

After the adjustments, the previously chaotic Rust core team was removed, and the temporary leadership position was completely abolished. Instead, each top team of the Rust project appointed a representative to form the Rust Leadership Council, responsible for top-level governance issues.

“We hope to build on success, improve on failure, and ultimately lead to greater transparency and accountability,” stated the Rust Leadership Council. Improving the transparency of the Rust leadership and repaying possible “governance debts” will be the focus of future work.

Most of the development and maintenance work of the Rust project, such as maintaining compilers and core tools, managing infrastructure, etc., is still handled by nine top teams. These nine teams cover the following: compiler, crates.io, development tools, infrastructure, language, launchpad, library, review, and release.

Interestingly, looking back, it can be seen that the governance crisis of Rust is closely related to its development history. The Rust language was initially an amateur project created by Mozilla employee Graydon Hoare in 2006, and it wasn’t until February 2021 that Rust was handed over to the independent Rust Foundation, which allowed the language to truly take off. Because of this, Rust has lacked a prominent technical authority leader since its inception.

In stark contrast is Python. Guido van Rossum is not only the founder of Python but was also given the title of “Benevolent Dictator For Life” (BDFL) (Guido announced in 2018 that he would no longer serve as BDFL).

For a language, who has the final decision-making power when controversies arise in the community largely determines the ultimate direction of its ecological development.

References:

https://opensource.googleblog.com/2023/06/rust-fact-vs-fiction-5-insights-from-googles-rust-journey-2022.html

https://analyticsindiamag.com/why-big-techs-are-pushing-rust/

https://www.infoworld.com/article/3701230/rust-language-project-revamps-governance.html

https://www.sohu.com/a/690332537_121124377

——Previous Recommendations——
1. After Chip Capping, the US is Overconfident!
2. OpenAI Establishes a Top Team, Heavily Recruiting Core Position Members, Aiming to Control Super AI Within Four Years!

The Myth of Rust Being Difficult to Learn

Leave a Comment