Rust: not hard to learn but is slow to compile, according to Google internal survey

Rust: not hard to learn but is slow to compile, according to Google internal survey

Google has posted data drawn from over 1,000 internal Rust developers, showing that Rust is no harder to learn than other programming languages – though it is slow to compile.

The survey covered “professional software developers (or a related field), employed at Google,” the report states.

The Rust language is admired for its high performance along with safety guarantees that other system languages such as C and C++ lack, but it is common to hear complaints that it is hard to learn because of unfamiliar concepts like ownership and borrowing. Ownership in Rust is a compile-time feature that provides safe and automatic memory management. “Because ownership is a new concept for many programmers, it does take some time to get used to,” the Rust documentation acknowledges.

According to the survey though, and although ownership and borrowing is listed as one of three “top challenges” in Rust, along with async programming and macros, developers pick up the language relatively quickly. More than two-thirds contribute to a Rust codebase within two months, and one third feel equally productive in Rust as in other languages again within two months. Concerns about interop and unsafe code are overdone, the report suggests.

Of those surveyed, only 13 percent had previous Rust experience, with most coming from C/C++, Python, Java, Go or Dart. “We’ve seen no data to indicate that there is any productivity penalty for Rust relative to any other language,” the report states.

The big problem with Rust though is the speed of compilation. “Slow build speeds were by far the #1 reported challenge that developers have when using Rust,” according to the report.

By way of mitigation, the Rust compiler does a great job, particularly in respect of diagnostic and debugging information. Examples given are a code suggestion when pattern matching was missing a case, and a warning of an unused comparison in another section of code.

Developers feel they write more correct code in Rust, with 85 percent more confident in this than when programming in other languages.

Tech giants like Google and Microsoft are taking a keen interest in Rust because it provides additional security without performance penalty. “Microsoft Azure security evolution: Embrace secure multitenancy, Confidential Compute, and Rust,” said Microsoft Azure CTO Mark Russinovich on Twitter last month.

Rust usage is increasing. A recent StackOverflow survey places Rust 14th in programming languages, with 13.05 percent of developers using it, just behind Go but above Kotlin.

Rust is a system language though and unlikely to reach the level of popularity of high level languages, which are designed for productivity and ease of use above performance.