It does so without a traditional garbage collector; instead, memory safety errors and data races are prevented by the "borrow checker", which tracks the object lifetime of references at compile time.
[13][14][15] Software developer Graydon Hoare created Rust as a personal project while working at Mozilla Research in 2006.
In the years following the first stable release in May 2015, Rust was adopted by companies including Amazon, Discord, Dropbox, Google (Alphabet), Meta, and Microsoft.
[17]: 15:34 [19] Early Rust contained features such as explicit object-oriented programming via an obj keyword (later removed),[17]: 10:08 and a typestates system that would allow variables of a type to be tracked along with state changes (such as going from uninitialized to initialized).
At Mozilla, executives would eventually employ over a dozen engineers to work on Rust full time over the next decade.
[26] Rust development at this time was focused on finalizing the language features and moving towards 1.0 so it could begin promising backward compatibility.
[17]: 43:15 The development of the Servo browser engine continued in parallel with Rust, jointly funded by Mozilla and Samsung.
[17]: 50:36 The earliest adoption outside of Mozilla was by individual projects at Samsung, Facebook (now Meta Platforms), Dropbox, and others including Tilde, Inc. (the company behind ember.js).
[16] Engineers cited performance, lack of a garbage collector, safety, and pleasantness of working in the language as reasons for the adoption, while acknowledging that it was a risky bet as Rust was new technology.
[30][note 5] In August 2020, Mozilla laid off 250 of its 1,000 employees worldwide, as part of a corporate restructuring caused by the COVID-19 pandemic.
[34] On February 8, 2021, the formation of the Rust Foundation was announced by five founding companies: Amazon Web Services, Google, Huawei, Microsoft, and Mozilla.
[35][36] The foundation, led by Shane Miller for its first two years, offered $20,000 grants and other support for programmers working on major Rust features.
[16] In a blog post published on April 6, 2021, Google announced support for Rust within the Android Open Source Project as an alternative to C/C++.
[48] Hoare has described Rust as targeted at frustrated C++ developers and emphasized features such as safety, control of memory layout, and concurrency.
For example, the following adds up all numbers between 1 and 100 that are multiples of 3: More generally, the loop keyword allows repeating a portion of code until a break occurs.
By default, integer literals are in base-10, but different radices are supported with prefixes, for example, 0b11 for binary numbers, 0o567 for octals, and 0xDB for hexadecimals.
[67] enums can take on different variants at runtime, with its capabilities similar to algebraic data types found in functional programming languages.
This enforces a form of software fault isolation as the owner of a value is solely responsible for its correctness and deallocation.
[90] Unsafe code may also be used for low-level functionality, such as volatile memory access, architecture-specific intrinsics, type punning, and inline assembly.
[no_std]; this enables applications, such as embedded devices, which want to remove dependency code or provide their own core data structures.
Editions are released to allow making limited breaking changes, such as promoting await to a keyword to support async/await features.
[147] rust-analyzer is a collection of utilities that provides Integrated development environments (IDEs) and text editors with information about a Rust project through the Language Server Protocol.
[153] Many of Rust's features are so-called zero-cost abstractions, meaning they are optimized away at compile time and incur no runtime penalty.
[168] Cloudflare, a company providing content delivery network services, used Rust to build a new web proxy named Pingora for increased performance and efficiency.
[188] In web development, Deno, a secure runtime for JavaScript and TypeScript, is built on top of V8 using Rust and Tokio.
[189] Other notable adoptions in this space include Ruffle, an open-source SWF emulator,[190] and Polkadot, an open source blockchain and cryptocurrency platform.
[191] Discord, an instant messaging software company, rewrote parts of its system in Rust for increased performance in 2020.
[14] Likewise, an article published on Nature shared several stories of bioinformaticians using Rust for its performance and safety.
[16][141] The Rust Foundation is a non-profit membership organization incorporated in United States, with the primary purposes of backing the technical project as a legal entity and helping to manage the trademark and infrastructure assets.
[198][47] It was established on February 8, 2021, with five founding corporate members (Amazon Web Services, Huawei, Google, Microsoft, and Mozilla).