Rust is Highly Valued! AWS Hires Co-Lead of Rust Compiler Team

Rust is Highly Valued! AWS Hires Co-Lead of Rust Compiler Team

整理 | 钰莹、核子可乐
前有微软使用 Rust 代替 C/C++ 编写 Windows 组件,后有 AWS 雇佣 Rust 编译器团队联合负责人 Felix Klock,Rust 可太香了!
AWS Hires Co-Lead of Rust Compiler Team Klock

Recently, AWS published an article expressing enthusiasm for Rust, outlining several ways the company is adopting the language. Matt Assay from AWS stated that the company is increasingly using Rust to build critical infrastructure such as Firecracker VMM, reducing the time and effort required to achieve the expected high security with its out-of-the-box capabilities, while enjoying the powerful runtime performance comparable to C and C++.

AWS is very fond of Rust and has even started hiring Rust and Tokio contributors to ensure they have the necessary time and resources to further improve Rust. The hired personnel include Sean McArthur (nominated in the “Thank-you” list for Rust 1.0), as well as renowned developers Lucio Franco and Jon Gjengset.

The post also revealed that AWS recently hired the co-lead of the project compiler, Felix Klock. Klock previously worked at Mozilla, and his LinkedIn profile mentions that he completed his work there in August 2020, when the organization underwent significant layoffs, and then joined AWS in October.

Shane Miller, Senior Software Engineering Manager at AWS, stated: “We have not only hired a few people for Tokio and the Rust compiler.”

“Rust is a key component of our long-term strategy, and we are investing to provide Rust engineering at Amazon scale. This includes developer tools, infrastructure components, interoperability, and validation.”

Tech Giants Show Strong Interest in Rust

Rust is a relatively young programming language, with its 1.0 version released only in 2015, but its popularity has not waned. According to feedback from over 65,000 developers, Rust has topped Stack Overflow’s “Most Loved” programming languages for five consecutive years. Additionally, Rust ranks in the top 20 in Redmonk’s programming language rankings. Considering the almost unshakeable positions of languages like Java, C, and JavaScript, this is undoubtedly a significant achievement for Rust.

In early February 2019, Microsoft mentioned in a presentation that 70% of security vulnerabilities are memory safety issues. Subsequently, in July, the Microsoft Security Response Center (MSRC) stated that Microsoft needs a safer systems programming language. In a series of articles that followed, Microsoft elaborated on why it believes Rust is currently the best choice in the industry. By the end of 2019, Microsoft revealed its experimental experience of using Rust instead of C/C++ to write Windows components, with engineers expressing that the experience of using Rust was delightful.

My task was to experimentally rewrite a low-level system component of the Windows codebase (which cannot be disclosed at this time). Although this project is not yet complete, overall, the experimental experience with Rust has been very positive. It is easy to port new components or existing components with clean interfaces to Rust.

The AWS article mentioned that one of the most exciting features of the Rust programming language is its ability to make infrastructure “super boring.” In development work, this kind of boredom is definitely a good thing, as no one wants their electrical wiring to get “excited” unexpectedly. AWS has benefited from Rust projects for years and has been working to contribute to them in meaningful ways.

Amazon publicly released its first well-known product written in Rust, Firecracker, in 2018. This product provides open-source virtualization technology that supports AWS Lambda and other serverless products. In addition, Amazon uses Rust to support services such as Amazon Simple Storage Service (Amazon S3), Amazon Elastic Compute Cloud (Amazon EC2), Amazon CloudFront, and Amazon Route 53. Recently, Amazon launched Bottlerocket, a Linux-based container operating system written in Rust. The Amazon EC2 team also uses Rust as the designated language for the new AWS Nitro System components (including sensitive applications like Nitro Enclaves).

So, why has Rust gained such popularity?

Delightful Development Experience

For C++ developers accustomed to writing complex systems, using Rust as a development language is like breathing fresh air. Since Rust does not require a runtime or garbage collector, it can achieve runtime performance similar to C and C++.

Moreover, Rust employs a strict type system and ownership model to perform memory and concurrency safety checks at compile time, thus controlling the testing and validation costs of Rust to be significantly lower than that of C/C++.

The warnings and error messages from Rust’s compiler are well-written, allowing novice Rust programmers to quickly identify and resolve issues in their code.

Low Learning Curve, Friendly Community

Rust has a wealth of online documentation and very helpful compiler error messages, making the learning curve for developers who have long used C++ quite simple. Additionally, Rust has tutorials specifically for C/C++ systems engineers. Jeremy Fitzhardinge from Facebook noted in his talk at RustConf 2019 that he found experienced C/C++ developers could get started with Rust in about four weeks, and become proficient in just eight weeks.

In addition to excellent documentation, there are useful tools like Clippy that allow experienced C++ developers to code directly in Rust without needing direct help from those with Rust experience.

Furthermore, the Rust community is very welcoming to newcomers, attracting many who have not previously participated in systems programming or open-source projects.

Safety

To achieve the desired safety guarantees from Rust, strict guidelines must be placed around the use of the unsafe keyword. Any calls to FFI functions should be done within wrapper functions that provide safe abstractions around them. Similarly, any other code that requires the unsafe keyword should also have wrapper functions or structures that provide safe abstractions.

In practice, apart from FFI boundaries, only very basic protocol handling requires the unsafe keyword. In such cases, writing some generic unsafe code is easy, and this code can be thoroughly unit tested and used in various situations, making it safer than C++. After getting used to writing Rust code, you will find writing C++ to be more frustrating because you cannot rely on the compiler to ensure memory safety.

In addition to ensuring safety, Rust has a set of internal coding standards that help new developers make the most of the language. Best practices for error handling, logging, locking, and other language-specific issues will lead to higher quality code more quickly.

Reference Links:

https://www.infoq.cn/article/Mqz2ZRqt9Pyu0OJoavra

https://aws.amazon.com/cn/blogs/opensource/why-aws-loves-rust-and-how-wed-like-to-help/

Today’s Recommended Articles

Click the image below to read

Rust is Highly Valued! AWS Hires Co-Lead of Rust Compiler Team

A programmer caused a platform crash by deleting a database due to not receiving a bonus, sentenced to 5 months; JD unilaterally dismissed a 38-year-old P7 employee; SpaceX Starlink testing time extended | AI Weekly News

Rust is Highly Valued! AWS Hires Co-Lead of Rust Compiler Team

Are you also “watching”? 👇

Leave a Comment