Inception and Evolution of Rust
Recently, I was going over the results of the 2022 annual Stack Overflow Developer survey results and learned that "Rust" was voted as the most loved language for the 7th year in a row. From amongst 71.4k survey participants, 87% of the participants love Rust and want to continue using Rust. I had heard of Rust before but these results prompted me to take a deeper dive into the history of Rust and why it is the most loved language.
Inception
Graydon Hoare a Software Engineer at Mozilla started Rust as a side project in 2006. Graydon was living in an apartment in Vancouver on the 21st floor. The elevator in his apartment building was frequently out of service with the primary reason being the software for the elevator crashing. On one such occasion where he had to climb up a flight of stairs to get to his apartment on the 21st floor Graydon thought that it was ridiculous that computer people could not make an elevator software that was crash proof.
Software systems written for elevators falls in the embedded systems category. Programming in this category is dominated by languages like Assembly, C and C++ (popularly referred to as systems programming languages) because of their "bare metal" nature making them compact, efficient and performant while interacting directly with the hardware. However, C and C++ programs are prone to segmentation faults, memory leaks, buffer overflows which could lead to accidental memory bugs causing the programs to crash abnormally and that must have been one of the reasons for the elevator in Graydon's building to crash.
Graydon decided to take matters in his hand and started his own side project for building a language that he hoped will be memory safe, secure, compact while also matching the performance of existing system programming languages. He named his side project "Rust" taking the reference from a group of hardworking fungi. He started to shape the language that "frustrated C++ developers" could look upon in order to obtain the same "bare metal" characteristics and system performance but free from memory leaks and unsecure behavior that C and C++ programs tend to have.
Evolution
After making progress and discussing his side project with his co-workers at Mozilla, Graydon and his colleagues soon formed a team at Mozilla that would continue to nurture the development of Rust and use it for building their experimental Servo parallel browser project. In 2009, Mozilla officially decided to sponsor Rust. The language was made open source.
In 2013, Hoare stepped aside from the project and the open source community and a core team at Mozilla continued iterating through the various versions of Rust. Initially built for system programming, Rust community started adding all the goodness of existing functional programming languages while also keeping the compiler and the language architecture to be as performant as system programming languages. Two key design decisions that were made include :
Removal of Garbage collector which will essentially decrease the massive overload and performance hit that happens because of the Garbage collection process and
Introducing ownership and borrowing to prevent memory leaks and errors which are strictly enforced by the user friendly Rust compiler.
In 2015 the first stable version of Rust was released and today it is touted as the hottest programming language being used by 2.8 million coders over the globe and is maintained passionately by an open source community creating several valued added projects using Rust.
Rust in Production
In 2016 Mozilla released Servo a new browser engine built using Rust. The following year, part of Firefox that renders CSS was written in Rust giving the browser a noticeable performance boost. Soon other companies were trying out Rust to rewrite pieces of their software system that could benefit from the memory safe, garbage collection free and high performant "Rust". Some of the early adopters include Samsung and Meta.
In 2020, Discord rewrote critical pieces of their software originally written in Go to Rust. Their analysis revealed that the garbage collector in Go was proving to be bottleneck for few of their systems and after implementing Rust, they are now seeing 10 times improvement in speed for their systems.
During the same year (2020), Dropbox released a new version of their "sync engine" written using Rust replacing the existing Python implementation. This rewrite has helped them to easily handle billions of files and trillions of files synchronized online.
Cloudflare handles 20% of its web traffic using proxy frameworks and systems and their implementations include both rewrites in Rust and using Rust to write new frameworks and systems.
In 2021, the formation of the Rust Foundation was announced by its five founding companies (AWS, Huawei, Google, Microsoft, and Mozilla). Today, Google, Microsoft, Meta and Amazon are all using Rust in many production systems and services. Worth mentioning blockchain projects like Solana, Polkadot and Near protocol that are also using Rust under the hood.
In December 2022, Rust support was officially added in Linux Kernel becoming only the second level after C to be supported in the development of the Linux Kernel which speaks volumes for the performance and security that the language offers.
I am pretty sure that there must be several other implementations that I might have not included above.
Today, Rust can be used not only as a replacement for C, C++ and other system programming languages in the field of systems programming but it also is being used to transform frontend, backend, database, desktop, cli tools and embedded systems development. It has evolved from just another systems programming language to a language that can be used to develop any system one can think of.
It seems to be a "no brainer" that the need for Rust programmers popularly called as "Rustaceans" is only going to increase in the upcoming months and years. I will be covering more technical topics on Rust in the upcoming days.