A brief history of Rust at Facebook

Facebook is embracing Rust, one of the most loved and fastest-growing programming languages available today. In addition to bringing new talent to its Rust team, Facebook has announced that it is o…

6 min readintermediate
--
View Original

Overview

Facebook has increasingly embraced Rust, a programming language known for its performance and safety, by joining the Rust Foundation and expanding its internal Rust development team. The article outlines the evolution of Rust usage at Facebook, highlighting key projects and the growing community of Rust developers within the company.

What You'll Learn

1

How to leverage Rust for high-performance applications

2

Why Facebook chose Rust over C++ for reliability in source control systems

3

When to adopt Rust for new projects within a large codebase

Prerequisites & Requirements

  • Understanding of programming languages, particularly C++
  • Experience with software development in large codebases(optional)

Key Questions Answered

What motivated Facebook to adopt Rust for its source control systems?
Facebook adopted Rust due to its focus on reliability and safety, which are critical for source control systems where corruption or downtime can halt services. The need for a language that could handle increased commit rates while ensuring code safety led to the decision to use Rust over C++.
How has Rust usage evolved at Facebook from 2016 to 2021?
Rust usage at Facebook began with the Mononoke project in 2016, aimed at improving source control. Over the years, as success stories emerged, interest grew, leading to the formation of a dedicated Rust team by 2021 to support and expand Rust's use across various projects.
What are the key areas of focus for Facebook's new Rust team?
The new Rust team at Facebook focuses on supporting internal users, contributing to the Rust community, ensuring interoperability with C++, and actively engaging with the Rust Foundation to promote the language's growth and adoption.

Key Statistics & Figures

Percentage of Diem blockchain codebase written in Rust
94 percent
This statistic highlights Rust's significant role in the development of the Diem blockchain, showcasing its reliability and performance in critical applications.
Number of Rust developers at Facebook by 2019
over 100
This growth reflects the increasing adoption and support for Rust within Facebook's engineering teams.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Consider adopting Rust for new projects where performance and safety are critical.
Rust's emphasis on compile-time error detection and performance improvements makes it an excellent choice for projects that require high reliability, especially in large-scale systems.
2
Engage with the Rust community and contribute to open-source projects.
By participating in the Rust community, developers can stay updated on best practices and contribute to the language's evolution, which can enhance their own projects and skills.
3
Utilize Rust's interoperability features when integrating with existing C++ codebases.
As many systems at Facebook are built on C++, ensuring that Rust components can safely interact with C++ libraries will be crucial for leveraging Rust's benefits without sacrificing existing infrastructure.

Common Pitfalls

1
Underestimating the learning curve associated with transitioning to Rust from languages like C++ or Python.
Many developers may find Rust's strict compile-time checks and ownership model challenging initially. It's important to invest time in understanding these concepts to fully leverage Rust's advantages.

Related Concepts

Programming Languages
Open-source Development
Software Reliability