0% found this document useful (0 votes)
2 views

Rust_(programming_language)

Rust is a general-purpose programming language focused on performance, type safety, and concurrency, utilizing a borrow checker for memory safety without a garbage collector. Developed by Graydon Hoare and sponsored by Mozilla, Rust has gained popularity in systems programming and has been adopted by major companies like Amazon and Google. The language has evolved significantly since its first stable release in 2015, with a strong community and ongoing support through the Rust Foundation established in 2021.

Uploaded by

nina.julian441
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Rust_(programming_language)

Rust is a general-purpose programming language focused on performance, type safety, and concurrency, utilizing a borrow checker for memory safety without a garbage collector. Developed by Graydon Hoare and sponsored by Mozilla, Rust has gained popularity in systems programming and has been adopted by major companies like Amazon and Google. The language has evolved significantly since its first stable release in 2015, with a strong community and ongoing support through the Rust Foundation established in 2021.

Uploaded by

nina.julian441
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Rust (programming language)

Rust is a general-purpose programming language


Rust
emphasizing performance, type safety, and
concurrency. It enforces memory safety, meaning that
all references point to valid memory. 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.
Paradigms Concurrent, functional,
Rust does not enforce a programming paradigm, but generic, imperative,
was influenced by ideas from functional programming, structured
including immutability, higher-order functions, Designed by Graydon Hoare
algebraic data types, and pattern matching. It also
Developer The Rust Team
supports object-oriented programming via structs,
enums, traits, and methods. It is popular for systems First appeared January 19, 2012
programming.[13][14][15] Stable release 1.84.1[1] / January 30,
2025
Software developer Graydon Hoare created Rust as a
personal project while working at Mozilla Research in Typing discipline Affine, inferred, nominal,
2006. Mozilla officially sponsored the project in 2009. static, strong

In the years following the first stable release in May Implementation OCaml (2006–2011)
2015, Rust was adopted by companies including language Rust (2012–present)
Amazon, Discord, Dropbox, Google (Alphabet), Meta, Platform Cross-platform[note 1]
and Microsoft. In December 2022, it became the first OS Cross-platform[note 2]
language other than C and assembly to be supported in
License MIT, Apache 2.0[note 3]
the development of the Linux kernel.
Filename .rs, .rlib
Rust has been noted for its rapid adoption, and has extensions
been studied in programming language theory Website rust-lang.org (https://ww
research. w.rust-lang.org/)
Influenced by

History Alef, BETA, CLU, C#, C++, Cyclone, Elm,


Erlang, Haskell, Hermes, Limbo, Mesa,
Napier, Newsqueak, NIL, OCaml, Ruby,
Sather, Scheme, Standard ML, Swift[5][6]
Early years (2006–2009)
Influenced
Rust began as a personal project in 2006 by Mozilla
Idris[7], Project Verona[8], SPARK[9], Swift[10],
employee Graydon Hoare.[16] Hoare has stated that
V[11], Zig[12]
Rust was named for the group of fungi that are "over-
engineered for survival".[16] During the time period
between 2006 and 2009, Rust was not publicized to others at Mozilla and was written in Hoare's free
time;[17]: 7:50 Hoare began speaking about the language around
2009 after a small group at Mozilla became interested in the
project.[18] Hoare emphasized prioritizing good ideas from old
languages over new development, citing languages including CLU
(1974), BETA (1975), Mesa (1977), NIL (1981), Erlang (1987),
Newsqueak (1988), Napier (1988), Hermes (1990), Sather (1990),
Alef (1992), and Limbo (1996) as influences, stating "many older
languages [are] better than new ones", and describing the language
as "technology from the past come to save the future from Mozilla Foundation headquarters in
itself."[17]: 8:17 [18] Early Rust developer Manish Goregaokar Mountain View, California
similarly described Rust as being based on "mostly decades-old
research."[16]

During the early years, the Rust compiler was written in about 38,000 lines of OCaml.[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).[17]: 13:12

Mozilla sponsorship (2009–2012)


Mozilla officially sponsored the Rust project in 2009.[16] Brendan Eich and other executives, intrigued by
the possibility of using Rust for a safe web browser engine, placed engineers on the project including
Patrick Walton, Niko Matsakis, Felix Klock, and Manish Goregaokar.[16] A conference room taken by the
project developers was dubbed "the nerd cave," with a sign placed outside the door.[16]

During this time period, work had shifted from the initial OCaml compiler to a self-hosting compiler, i.e.,
written in Rust, based on LLVM.[20][note 4] The Rust ownership system was also in place by 2010.[16] The
Rust logo was developed in 2011 based on a bicycle chainring.[22]

The first public release, Rust 0.1 was released on January 20, 2012[23] for Windows, Linux, and
MacOS.[24] The early 2010s saw increasing involvement from open source volunteers outside of Mozilla
and outside of the United States. At Mozilla, executives would eventually employ over a dozen engineers
to work on Rust full time over the next decade.[16]

Evolution (2012–2015)
The years from 2012 to 2015 were marked by substantial changes to the Rust type system, especially,
removal of the typestate system, consolidation of other language features, and the removal of the garbage
collector.[17]: 18:36 [16] Memory management through the ownership system was gradually consolidated
and expanded to prevent memory-related bugs. By 2013, the garbage collector feature was rarely used,
and was removed by the team in favor of the ownership system.[16] Other changes during this time
included the removal of pure functions, which were declared by an explicit pure annotation, in March
2013.[25] Specialized syntax support for channels and various pointer types were removed to simplify the
language.[17]: 22:32
Rust's expansion and consolidation was influenced by developers coming from C++ (e.g., low-level
performance of features), scripting languages (e.g., Cargo and package management), and functional
programming (e.g., type systems development).[17]: 30:50

Graydon Hoare stepped down from Rust in 2013.[16] This allowed it to evolve organically under a more
federated governance structure, with a "core team" of initially 6 people,[17]: 21:45 around 30-40 developers
total across various other teams,[17]: 22:22 and a Request for Comments (RFC) process for new language
features added in March 2014.[17]: 33:47 The core team would grow to 9 people by 2016[17]: 21:45 with over
1600 proposed RFCs.[17]: 34:08

According to Andrew Binstock writing for Dr. Dobb's Journal in January 2014, while Rust was "widely
viewed as a remarkably elegant language", adoption slowed because it radically changed from version to
version.[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]: 41:26

Six years after Mozilla sponsored its development, the first stable release, Rust 1.0, was published on
May 15, 2015.[16] A year after the release, the Rust compiler had accumulated over 1,400 contributors
and there were over 5,000 third-party libraries published on the Rust package management website
Crates.io.[17]: 43:15

Servo and early adoption (2015–2020)


The development of the Servo browser engine continued in
parallel with Rust, jointly funded by Mozilla and Samsung.[27]
The teams behind the two projects worked in close collaboration;
new features in Rust were tested out by the Servo team, and new
features in Servo were used to give feedback back to the Rust
team.[17]: 5:41 The first version of Servo was released in 2016.[16]
The Firefox web browser shipped with Rust code as of 2016 Early homepage of Mozilla's Servo
(version 45),[17]: 53:30 [28] but components of Servo did not appear browser engine
in Firefox until September 2017 (version 57) as part of the Gecko
and Quantum projects.[29]

Improvements were made to the Rust toolchain ecosystem during the years following 1.0 including
Rustfmt, integrated development environment integration,[17]: 44:56 a regular compiler testing and release
cycle,[17]: 46:48 a community code of conduct, and community discussion organized through an IRC
chat.[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).[17]: 55:44 [16]
Amazon Web Services followed in 2020.[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. Amazon developers cited the fact that Rust uses half as
much electricity as similar code written in Java, behind only C,[16] as found by a study at the University
of Minho, NOVA University Lisbon, and the University of Coimbra.[30][note 5]
Mozilla layoffs and Rust Foundation (2020–present)
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.[31][32] The team behind Servo was disbanded. The
event raised concerns about the future of Rust, due to the overlap between the two projects.[33] In the
following week, the Rust Core Team acknowledged the severe impact of the layoffs and announced that
plans for a Rust foundation were underway. The first goal of the foundation would be to take ownership
of all trademarks and domain names, and take financial responsibility for their costs.[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++.[37]

On November 22, 2021, the Moderation Team, which was responsible for enforcing the community code
of conduct, announced their resignation "in protest of the Core Team placing themselves unaccountable to
anyone but themselves".[38] In May 2022, the Rust Core Team, other lead programmers, and certain
members of the Rust Foundation board implemented governance reforms in response to the incident.[39]

The Rust Foundation posted a draft for a new trademark policy on April 6, 2023, including rules for how
the Rust logo and name can be used, which resulted in negative reactions from Rust users and
contributors.[40]

On February 26, 2024, the U.S. White House released a 19-page press report urging software
development to move to memory-safe programming languages; specifically, moving away from C and
C++ and encouraging languages like C#, Go, Java, Ruby, Swift, and Rust.[41][42] The report was widely
interpreted as increasing interest in Rust.[43][44] The report was released through the Office of the
National Cyber Director.[41][45]

Syntax and features


Rust's syntax is similar to that of C and C++,[46][47] although many of its features were influenced by
functional programming languages such as OCaml.[48] Hoare has described Rust as targeted at frustrated
C++ developers and emphasized features such as safety, control of memory layout, and concurrency.[18]
Safety in Rust includes the guarantees of memory safety, type safety, and lack of data races.

Hello World program


Below is a "Hello, World!" program in Rust. The fn keyword denotes a function, and the println!
macro (see § Macros) prints the message to standard output.[49] Statements in Rust are separated by
semicolons.

fn main() {
println!("Hello, World!");
}
Variables
Variables in Rust are defined through the let keyword.[50] The example below assigns a value to the
variable with name foo and outputs its value.

fn main() {
let foo = 10;
println!("The value of foo is {foo}");
}

Variables are immutable by default, and adding the mut keyword allows the variable to be mutated.[51]
The following example uses //, which denotes the start of a comment.[52]

fn main() {
// This code would not compile without adding "mut".
let mut foo = 10;
println!("The value of foo is {foo}");
foo = 20;
println!("The value of foo is {foo}");
}

Multiple let expressions can define multiple variables with the same name, known as variable
shadowing. Variable shadowing allows transforming variables without having to name the variables
differently.[53] The example below declares a new variable with the same name that is double the original
value:

fn main() {
let foo = 10;
// This will output "The value of foo is 10"
println!("The value of foo is {foo}");
let foo = foo * 2;
// This will output "The value of foo is 20"
println!("The value of foo is {foo}");
}

Variable shadowing is also possible for values of different types, going from a string to its length:

fn main() {
let letters = "abc";
let letters = letters.len();
}

Block expressions and control flow


A block expression is delimited by curly brackets. When the last expression inside a block does not end
with a semicolon, the block evaluates to the value of that trailing expression:[54]

fn main() {
let x = {
println!("this is inside the block");
1 + 2
};
println!("1 + 2 = {x}");
}
Trailing expressions of function bodies are used as the return value:[55]

fn add_two(x: i32) -> i32 {


x + 2
}

if expressions
An if conditional expression executes code based on whether the given value is true. else can be
used for when the value evaluates to false, and else if can be used for combining multiple
expressions.[56]

fn main() {
let x = 10;
if x > 5 {
println!("value is greater than five");
}

if x % 7 == 0 {
println!("value is divisible by 7");
} else if x % 5 == 0 {
println!("value is divisible by 5");
} else {
println!("value is not divisible by 7 or 5");
}
}

if and else blocks can evaluate to a value, which can then be assigned to a variable:[56]

fn main() {
let x = 10;
let new_x = if x % 2 == 0 { x / 2 } else { 3 * x + 1 };
println!("{new_x}");
}

while loops
while can be used to repeat a block of code while a condition is met.[57]

fn main() {
// Iterate over all integers from 4 to 10
let mut value = 4;
while value <= 10 {
println!("value = {value}");
value += 1;
}
}

for loops and iterators


For loops in Rust loop over elements of a collection.[58] for expressions work over any iterator type.

fn main() {
// Using `for` with range syntax for the same functionality as above
// The syntax 4..=10 means the range from 4 to 10, up to and including 10.
for value in 4..=10 {
println!("value = {value}");
}
}

In the above code, 4..=10 is a value of type Range which implements the Iterator trait. The code
within the curly braces is applied to each element returned by the iterator.

Iterators can be combined with functions over iterators like map, filter, and sum. For example, the
following adds up all numbers between 1 and 100 that are multiples of 3:

(1..=100).filter(|&x| x % 3 == 0).sum()

loop and break statements


More generally, the loop keyword allows repeating a portion of code until a break occurs. break may
optionally exit the loop with a value. In the case of nested loops, labels denoted by 'label_name can
be used to break an outer loop rather than the innermost loop.[59]

fn main() {
let value = 456;
let mut x = 1;
let y = loop {
x *= 10;
if x > value {
break x / 10;
}
};
println!("largest power of ten that is smaller than or equal to value: {y}");

let mut up = 1;
'outer: loop {
let mut down = 120;
loop {
if up > 100 {
break 'outer;
}

if down < 4 {
break;
}

down /= 2;
up += 1;
println!("up: {up}, down: {down}");
}
up *= 2;
}
}

Pattern matching
The match and if let expressions can be used for pattern matching. For example, match can be
used to double an optional integer value if present, and return zero otherwise:[60]

fn double(x: Option<u64>) -> u64 {


match x {
Some(y) => y * 2,
None => 0,
}
}
Equivalently, this can be written with if let and else:

fn double(x: Option<u64>) -> u64 {


if let Some(y) = x {
y * 2
} else {
0
}
}

Types
Rust is strongly typed and statically typed, meaning that the types of all variables must be known at
compilation time. Assigning a value of a particular type to a differently typed variable causes a
compilation error. Type inference is used to determine the type of variables if unspecified.[61]

The default integer type is i32, and the default floating point type is f64. If the type of a literal number
is not explicitly provided, it is either inferred from the context or the default type is used.[62]

Primitive types
Integer types in Rust are named based on the signedness and the number of bits the type takes. For
example, i32 is a signed integer that takes 32 bits of storage, whereas u8 is unsigned and only takes 8
bits of storage. isize and usize take storage depending on the architecture of the computer that runs
the code, for example, on computers with 32-bit architectures, both types will take up 32 bits of space.

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. By default, integer literals
default to i32 as its type. Suffixes such as 4u32 can be used to explicitly set the type of a literal.[63]
Byte literals such as b'X' are available to represent the ASCII value (as a u8) of a specific character.[64]

The Boolean type is referred to as bool which can take a value of either true or false. A char takes
up 32 bits of space and represents a Unicode scalar value: a Unicode codepoint that is not a surrogate.[65]
IEEE 754 floating point numbers are supported with f32 for single precision floats and f64 for double
precision floats.[66]

User-defined types
User-defined types are created with the struct or enum keywords. The struct keyword is used to
denote a record type that groups multiple related values.[67] enums can take on different variants at
runtime, with its capabilities similar to algebraic data types found in functional programming
languages.[68] Both records and enum variants can contain fields with different types.[69] Alternative
names, or aliases, for the same type can be defined with the type keyword.[70]

The impl keyword can define methods for a user-defined type. Data and functions are defined
separately. Implementations fulfill a role similar to that of classes within other languages.[71]
Standard library

Summary of Rust's types in the standard library


Type Description Examples

String::new()
UTF-8-encoded strings
String String::from("Hello")
(dynamic)
🦀🦀🦀".to_string()
"

Platform-native
OsStr strings[note 6] OsStr::new("Hello")
OsString (borrowed[72] and OsString::from("world")
dynamic[73])

Path Paths (borrowed[74] and Path::new("./path/to")


PathBuf dynamic[75]) PathBuf::from(r"C:.\path\to")

C-compatible, null- c"Hello"


CStr terminated strings
(borrowed[76] and CStr::from_bytes_with_nul(b"Hello\0").unwrap()
CString
dynamic[76]) CString::new("world").unwrap()

Vec::new()
Vec<T> Dynamic arrays
vec![1, 2, 3, 4, 5]

None
Option<T> Option type Some(3)
Some("hello")

Result<T, Error handling using a Ok(3)


E> result type Err("something went wrong")

A pointer to a heap-
allocated value.[77]
Similar to C++'s let boxed: Box<u8> = Box::new(5);
Box<T> let val: u8 = *boxed;
std::unique_ptr (https://e
n.cppreference.com/w/cp
p/memory/unique_ptr).

Reference counting let five = Rc::new(5);


Rc<T>
pointer[78] let also_five = five.clone();

Atomic, thread-safe
let foo = Arc::new(vec![1.0, 2.0]);
Arc<T> reference counting let a = foo.clone(); // a can be sent to another thread
pointer[79]

A mutable memory let c = Cell::new(5);


Cell<T>
location[80] c.set(10);
A mutex lock for shared let mutex = Mutex::new(0_u32);
Mutex<T>
data contained within.[81] let _guard = mutex.lock();

let lock = RwLock::new(5);


RwLock<T> Readers–writer lock[82] let r1 = lock.read().unwrap();

let (lock, cvar) = (Mutex::new(true), Condvar::new());


A conditional monitor for // As long as the value inside the `Mutex<bool>` is
Condvar `true`, we wait.
shared data[83] let _guard = cvar.wait_while(lock.lock().unwrap(),
|pending| { *pending }).unwrap();

Type that represents a


Duration Duration::from_millis(1) // 1ms
span of time[84]

let mut player_stats = HashMap::new();


HashMap<K,
Hash table[85] player_stats.insert("damage", 1);
V> player_stats.entry("health").or_insert(100);

let mut solar_distance = BTreeMap::from([


("Mercury", 0.4),
BTreeMap<K,
B-tree[86] ("Venus", 0.7),
V> ]);
solar_distance.entry("Earth").or_insert(1.0);

Option values are handled using syntactic sugar, such as the if let construction, to access the inner
value (in this case, a string):[87]

fn main() {
let name1: Option<&str> = None;
// In this case, nothing will be printed out
if let Some(name) = name1 {
println!("{name}");
}

let name2: Option<&str> = Some("Matthew");


// In this case, the word "Matthew" will be printed out
if let Some(name) = name2 {
println!("{name}");
}
}
Pointers

Summary of Rust's pointer and reference primitive types


Type Description Examples

&T let x_ref = &x;


References (immutable and mutable)
&mut T let x_ref = &mut x;

None
Option<&T> Option wrapped reference
let x_ref = Some(&x);
Option<&mut T> Possibly null reference
let x_ref = Some(&mut x);

A pointer to heap-allocated value


let boxed = Box::new(0);
Box<T> (or possibly null pointer if wrapped
let boxed = Some(Box::new("Hello
Option<Box<T>> in option)[76] World"));

*const T Raw pointers (immutable and mutable) let x_ptr = &x as *const T;
*mut T Possibly null; unsafe to dereference let x_ptr = &mut x as *mut T;

Rust does not use null pointers to indicate a lack of data, as doing so can lead to null dereferencing.
Accordingly, the basic & and &mut references are guaranteed to not be null. Rust instead uses Option
for this purpose: Some(T) indicates that a value is present, and None is analogous to the null
pointer.[88] Option implements a "null pointer optimization", avoiding any spatial overhead for types
that cannot have a null value (references or the NonZero types, for example).[89]

Unlike references, the raw pointer types *const and *mut may be null; however, it is impossible to
dereference them unless the code is explicitly declared unsafe through the use of an unsafe block.
Unlike dereferencing, the creation of raw pointers is allowed inside of safe Rust code.[90]

Type conversion
Rust provides no implicit type conversion (coercion) between primitive types. But, explicit type
conversion (casting) can be performed using the as keyword.[91]

let x = 1000;
println!("1000 as a u16 is: {}", x as u16);

Ownership
Rust's ownership system consists of rules that ensure memory safety without using a garbage collector. At
compile time, each value must be attached to a variable called the owner of that value, and every value
must have exactly one owner.[92] Values are moved between different owners through assignment or
passing a value as a function parameter. Values can also be borrowed, meaning they are temporarily
passed to a different function before being returned to the owner.[93] With these rules, Rust can prevent
the creation and use of dangling pointers:[93][94]

fn print_string(s: String) {
println!("{}", s);
}
fn main() {
let s = String::from("Hello, World");
print_string(s); // s consumed by print_string
// s has been moved, so cannot be used any more
// another print_string(s); would result in a compile error
}

Because of these ownership rules, Rust types are known as linear or affine types, meaning each value can
be used exactly once. This enforces a form of software fault isolation as the owner of a value is solely
responsible for its correctness and deallocation.[95]

When a value goes out of scope, it is dropped by running its destructor. The destructor may be
programmatically defined through implementing the Drop trait. This helps manage resources such as file
handles, network sockets, and locks, since when objects are dropped, the resources associated with them
are closed or released automatically.[96]

Lifetimes
Object lifetime refers to the period of time during which a reference is valid; that is, the time between the
object creation and destruction.[97] These lifetimes are implicitly associated with all Rust reference types.
While often inferred, they can also be indicated explicitly with named lifetime parameters (often denoted
'a, 'b, and so on).[98]

Lifetimes in Rust can be thought of as lexically scoped, meaning that the duration of an object lifetime is
inferred from the set of locations in the source code (i.e., function, line, and column numbers) for which a
variable is valid.[99] For example, a reference to a local variable has a lifetime corresponding to the block
it is defined in:[99]

fn main() {
let x = 5; // ------------------+- Lifetime 'a
// |
let r = &x; // -+-- Lifetime 'b |
// | |
println!("r: {}", r); // | |
// | |
// -+ |
} // ------------------+

The borrow checker in the Rust compiler then enforces that references are only used in the locations of
the source code where the associated lifetime is valid.[100][101] In the example above, storing a reference
to variable x in r is valid, as variable x has a longer lifetime ('a) than variable r ('b). However, when x
has a shorter lifetime, the borrow checker would reject the program:

fn main() {
let r; // ------------------+- Lifetime 'a
// |
{ // |
let x = 5; // -+-- Lifetime 'b |
r = &x; // | | // ERROR here: x does not live long
enough
} // -| |
// |
println!("r: {}", r); // |
} // ------------------+
Since the lifetime of the referenced variable ('b) is shorter than the lifetime of the variable holding the
reference ('a), the borrow checker errors, preventing x from being used from outside its scope.[102]

Lifetimes can be indicated using explicit lifetime parameters on function arguments. For example, the
following code specifies that the reference returned by the function has the same lifetime as original
(and not necessarily the same lifetime as prefix):[103]

fn remove_prefix<'a>(mut original: &'a str, prefix: &str) -> &'a str {


if original.starts_with(prefix) {
original = original[prefix.len()..];
}
original
}

When user-defined types hold references to data, they also need to use lifetime parameters. The example
below parses some configuration options from a string and creates a struct containing the options. The
function parse_config also showcases lifetime elision, which reduces the need for explicitly defining
lifetime parameters.[104]

use std::collections::HashMap;

// This struct has one lifetime parameter, 'src. The name is only used within the struct's definition.
#[derive(Debug)]
struct Config<'src> {
hostname: &'src str,
username: &'src str,
}

// The '_ lifetime parameter, in this case, refers to the anonymous lifetime attached to the type
// of the argument `config`.
fn parse_config(config: &str) -> Config<'_> {
let key_values: HashMap<_, _> = config
.lines()
.filter(|line| !line.starts_with('#'))
.filter_map(|line| line.split_once('='))
.map(|(key, value)| (key.trim(), value.trim()))
.collect();
Config {
hostname: key_values["hostname"],
username: key_values["username"],
}
}

fn main() {
let config = parse_config(
r#"hostname = foobar
username=barfoo"#,
);
println!("Parsed config: {:#?}", config);
}

In the compiler, ownership and lifetimes work together to prevent memory safety issues such as dangling
pointers.[105][106]
Polymorphism

Generics
Rust's more advanced features include the use of generic functions.
A generic function is given generic parameters, which allow the
same function to be applied to different variable types. This
A presentation on Rust by Emily
capability reduces duplicate code[107] and is known as parametric Dunham from Mozilla's Rust team
polymorphism. (linux.conf.au conference, Hobart,
2017)
The following program calculates the sum of two things, for which
addition is implemented using a generic function:

use std::ops::Add;

// sum is a generic function with one type parameter, T


fn sum<T>(num1: T, num2: T) -> T
where
T: Add<Output = T>, // T must implement the Add trait where addition returns another T
{
num1 + num2 // num1 + num2 is syntactic sugar for num1.add(num2) provided by the Add trait
}

fn main() {
let result1 = sum(10, 20);
println!("Sum is: {}", result1); // Sum is: 30

let result2 = sum(10.23, 20.45);


println!("Sum is: {}", result2); // Sum is: 30.68
}

At compile time, polymorphic functions like sum are instantiated with the specific types the code
requires; in this case, sum of integers and sum of floats.

Generics can be used in functions to allow implementing a behavior for different types without repeating
the same code. Generic functions can be written in relation to other generics, without knowing the actual
type.[108]

Traits
Rust's type system supports a mechanism called traits, inspired by
type classes in the Haskell language,[6] to define shared behavior
between different types. For example, the Add trait can be
implemented for floats and integers, which can be added; and the
Display or Debug traits can be implemented for any type that
can be converted to a string. Traits can be used to provide a set of
common behavior for different types without knowing the actual
type. This facility is known as ad hoc polymorphism.

Generic functions can constrain the generic type to implement a


particular trait or traits; for example, an add_one function might
require the type to implement Add. This means that a generic Excerpt from std::io
function can be type-checked as soon as it is defined. The
implementation of generics is similar to the typical
implementation of C++ templates: a separate copy of the code is generated for each instantiation. This is
called monomorphization and contrasts with the type erasure scheme typically used in Java and Haskell.
Type erasure is also available via the keyword dyn (short for dynamic).[109] Because monomorphization
duplicates the code for each type used, it can result in more optimized code for specific-use cases, but
compile time and size of the output binary are also increased.[110]

In addition to defining methods for a user-defined type, the impl keyword can be used to implement a
trait for a type.[71] Traits can provide additional derived methods when implemented.[111] For example,
the trait Iterator requires that the next method be defined for the type. Once the next method is
defined, the trait can provide common functional helper methods over the iterator, such as map or
filter.[112]

Trait objects
Rust traits are implemented using static dispatch, meaning that the type of all values is known at compile
time; however, Rust also uses a feature known as trait objects to accomplish dynamic dispatch, a type of
polymorphism where the implementation of a polymorphic operation is chosen at runtime. This allows
for behavior similar to duck typing, where all data types that implement a given trait can be treated as
functionally equivalent.[113] Trait objects are declared using the syntax dyn Tr where Tr is a trait. Trait
objects are dynamically sized, therefore they must be put behind a pointer, such as Box.[114] The
following example creates a list of objects where each object can be printed out using the Display trait:

use std::fmt::Display;

let v: Vec<Box<dyn Display>> = vec![


Box::new(3),
Box::new(5.0),
Box::new("hi"),
];

for x in v {
println!("{x}");
}

If an element in the list does not implement the Display trait, it will cause a compile-time error.[115]

Memory safety
Rust is designed to be memory safe. It does not permit null pointers, dangling pointers, or data
races.[116][117][118][119] Data values can be initialized only through a fixed set of forms, all of which
require their inputs to be already initialized.[120]

Unsafe code can subvert some of these restrictions, using the unsafe keyword.[90] Unsafe code may
also be used for low-level functionality, such as volatile memory access, architecture-specific intrinsics,
type punning, and inline assembly.[121]

Memory management
Rust does not use garbage collection. Memory and other resources are instead managed through the
"resource acquisition is initialization" convention,[122] with optional reference counting. Rust provides
deterministic management of resources, with very low overhead.[123] Values are allocated on the stack by
default, and all dynamic allocations must be explicit.[124]

The built-in reference types using the & symbol do not involve run-time reference counting. The safety
and validity of the underlying pointers is verified at compile time, preventing dangling pointers and other
forms of undefined behavior.[125] Rust's type system separates shared, immutable references of the form
&T from unique, mutable references of the form &mut T. A mutable reference can be coerced to an
immutable reference, but not vice versa.[126]

Macros
Macros allow generation and transformation of Rust code to reduce repetition. Macros come in two
forms, with declarative macros defined through macro_rules!, and procedural macros, which are
defined in separate crates.[127][128]

Declarative macros
A declarative macro (also called a "macro by example") is a macro, defined using the macro_rules!
keyword, that uses pattern matching to determine its expansion.[129][130] Below is an example that sums
over all its arguments:

macro_rules! sum {
( $initial:expr $(, $expr:expr )* $(,)? ) => {
$initial $(+ $expr)*
}
}

fn main() {
let x = sum!(1, 2, 3);
println!("{x}"); // prints 6
}

Procedural macros
Procedural macros are Rust functions that run and modify the compiler's input token stream, before any
other components are compiled. They are generally more flexible than declarative macros, but are more
difficult to maintain due to their complexity.[131][132]

Procedural macros come in three flavors:

Function-like macros custom!(...)


Derive macros #[derive(CustomDerive)]
Attribute macros #[custom_attribute]

Interface with C and C++


Rust has a foreign function interface (FFI) that can be used both to call code written in languages such as
C from Rust and to call Rust code from those languages. As of 2024, an external library called CXX
exists for calling to or from C++.[133] Rust and C differ in how they lay out structs in memory, so Rust
structs may be given a #[repr(C)] attribute, forcing the same layout as the equivalent C struct.[134]
Ecosystem
The Rust ecosystem includes its compiler, its standard library, and
additional components for software development. Component
installation is typically managed by rustup, a Rust toolchain
installer developed by the Rust project.[135]

Compiler
Compiling a Rust program with
The Rust compiler, rustc, translates Rust code into low-level Cargo
LLVM IR. LLVM is then invoked as a subcomponent to apply
optimizations and translate the resulting IR into object code. A
linker is then used to combine the objects into a single executable image or binary file.[136]

Other than LLVM, the compiler also supports using alternative backends such as GCC and Cranelift for
code generation.[137] The intention of those alternative backends is to increase platform coverage of Rust
or to improve compilation times.[138][139]

Standard library
The Rust standard library defines and implements many widely used custom data types, including core
data structures such as Vec, Option, and HashMap, as well as smart pointer types. Rust also provides a
way to exclude most of the standard library using the attribute #![no_std]; this enables applications,
such as embedded devices, which want to remove dependency code or provide their own core data
structures. Internally, the standard library is divided into three parts, core, alloc, and std, where std
and alloc are excluded by #![no_std].[140]

Cargo
Cargo is Rust's build system and package manager. It downloads,
compiles, distributes, and uploads packages—called crates—that
are maintained in an official registry. It also acts as a front-end for
Clippy and other Rust components.[141]
Screenshot of crates.io in June
By default, Cargo sources its dependencies from the user-
2022
contributed registry crates.io, but Git repositories and crates in the
local filesystem, and other external sources can also be specified
as dependencies.[142]

Rustfmt
Rustfmt is a code formatter for Rust. It formats whitespace and indentation to produce code in accordance
with a common style, unless otherwise specified. It can be invoked as a standalone program, or from a
Rust project through Cargo.[143]
Clippy
Clippy is Rust's built-in linting tool to improve the correctness,
performance, and readability of Rust code. As of 2024, it has more
than 700 rules.[144][145]

Versioning system
Following Rust 1.0, new features are developed in nightly versions
which are released daily. During each six-week release cycle, Example output of Clippy on a hello
changes to nightly versions are released to beta, while changes world Rust program
from the previous beta version are released to a new stable
version.[146]

Every two or three years, a new "edition" is produced. Editions are released to allow making limited
breaking changes, such as promoting await to a keyword to support async/await features. Crates
targeting different editions can interoperate with each other, so a crate can upgrade to a new edition even
if its callers or its dependencies still target older editions. Migration to a new edition can be assisted with
automated tooling.[147]

IDE support
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. This enables
features including autocompletion, and the display of compilation errors while editing.[148]

Performance
In general, Rust's memory safety guarantees do not impose a runtime overhead.[149] A notable exception
is array indexing which is checked at runtime, though this often does not impact performance.[150] Since
it does not perform garbage collection, Rust is often faster than other memory-safe languages.[151][95][152]

Rust provides two "modes": safe and unsafe. Safe mode is the "normal" one, in which most Rust is
written. In unsafe mode, the developer is responsible for the code's memory safety, which is used by
developers for cases where the compiler is too restrictive.[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.[154] The ownership and borrowing system permits zero-copy
implementations for some performance-sensitive tasks, such as parsing.[155] Static dispatch is used by
default to eliminate method calls, with the exception of methods called on dynamic trait objects.[156] The
compiler also uses inline expansion to eliminate function calls and statically-dispatched method
invocations.[157]

Since Rust utilizes LLVM, any performance improvements in LLVM also carry over to Rust.[158] Unlike
C and C++, Rust allows for reordering struct and enum elements[159] to reduce the sizes of structures in
memory, for better memory alignment, and to improve cache access efficiency.[160]
Adoption
Rust is used in software across different domains. Components from the
Servo browser engine (funded by Mozilla and Samsung) were incorporated in
the Gecko browser engine underlying Firefox.[161] In January 2023, Google
(Alphabet) announced support for using third party Rust libraries in
Chromium.[162][163]

Rust is used in several backend software projects of large web services.


OpenDNS, a DNS resolution service owned by Cisco, uses Rust
internally.[164][165] Amazon Web Services uses Rust in "performance- Firefox has components
sensitive components" of its several services. In 2019, AWS open-sourced written in Rust as part of
Firecracker, a virtualization solution primarily written in Rust. [166] Microsoft the underlying Gecko
Azure IoT Edge, a platform used to run Azure services on IoT devices, has browser engine.

components implemented in Rust.[167] Microsoft also uses Rust to run


containerized modules with WebAssembly and Kubernetes.[168] Cloudflare, a company providing content
delivery network services, used Rust to build a new web proxy named Pingora for increased performance
and efficiency.[169] The npm package manager used Rust for its production authentication service in
2019.[170][171][172]

In operating systems, the Rust for Linux project, launched in 2020, merged
initial support into the Linux kernel version 6.1 in late 2022.[173][174][175] The
project is active with a team of 6-7 developers, and has added additional Rust
code with kernel releases from 2022 to 2024,[176] aiming to demonstrate the
minimum viability of the project and resolve key compatibility
blockers.[173][177] The first drivers written in Rust were merged into the
kernel for version 6.8.[173] The Android developers used Rust in 2021 to
rewrite existing components.[178][179] Microsoft has rewritten parts of
The Rust for Linux
Windows in Rust.[180] The r9 project aims to re-implement Plan 9 from Bell
project has been
Labs in Rust.[181] Rust has been used in the development of new operating supported in the Linux
systems such as Redox, a "Unix-like" operating system and microkernel,[182] kernel since 2022.
Theseus, an experimental operating system with modular state
management,[183][184] and most of Fuchsia.[185] Rust is also used for
command-line tools and operating system components, including stratisd, a file system manager[186][187]
and COSMIC, a desktop environment by System76.[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. In the same year, Dropbox announced that its file synchronization had been
rewritten in Rust. Facebook (Meta) used Rust to redesign its system that manages source code for internal
projects.[16]
In the 2024 Stack Overflow Developer Survey, 12.6% of respondents had recently done extensive
development in Rust.[192] The survey named Rust the "most admired programming language" every year
from 2016 to 2024 (inclusive), based on the number of existing developers interested in continuing to
work in the same language.[193][note 7] In 2024, Rust was the 6th "most wanted technology", with 28.7%
of developers not currently working in Rust expressing an interest in doing so.[192]

In academic research
Rust has been studied in academic research, both for properties of the language itself as well as the utility
the language provides for writing software used for research. Its features around safety[194][153] and
performance[195] have been examined.

In a journal article published to Proceedings of the International Astronomical Union, astrophysicists


Blanco-Cuaresma and Bolmont re-implemented programs responsible for simulating multi-planet
systems in Rust, and found it to be a competitive programming language for its "speed and accuracy".[14]
Likewise, an article published on Nature shared several stories of bioinformaticians using Rust for its
performance and safety.[141] However, both articles have cited Rust's unique concepts, including its
ownership system, being difficult to learn as one of the main drawbacks to adopting Rust.

Community
Rust has been noted as having an inclusive community, and
particularly welcomed people from the queer community, partly
due to its code of conduct which outlined a set of expectations for
Rust community members to follow. One MIT Technology
Review article described the Rust community as "unusually
friendly" to newcomers.[16][141]

Rust Foundation Some Rust users refer to


themselves as Rustaceans (similar
The Rust Foundation is a non-profit membership organization to the word crustacean) and have
incorporated in United States, with the primary purposes of adopted an orange crab, Ferris, as
backing the technical project as a legal entity and helping to their unofficial mascot.[196][197]
manage the trademark and infrastructure assets.[198][47]

It was established on February 8, 2021, with five Rust Foundation


founding corporate members (Amazon Web Services,
Huawei, Google, Microsoft, and Mozilla).[199] The
foundation's board is chaired by Shane Miller.[200]
Starting in late 2021, its Executive Director and CEO
is Rebecca Rumbul.[201] Prior to this, Ashley Williams Formation February 8, 2021
was interim executive director.[47] Founders Amazon Web Services
Google
Huawei
Governance teams Microsoft

The Rust project is composed of teams that are Mozilla Foundation


responsible for different subareas of the development. Type Nonprofit organization
The compiler team develops, manages, and optimizes Location United States
compiler internals; and the language team designs new
language features and helps implement them. The Rust Chairperson Shane Miller
project website lists 6 top-level teams as of July Executive Rebecca Rumbul
Director
2024.[202] Representatives among teams form the
Leadership council, which oversees the Rust project as Website foundation.rust-lang.org (http
a whole.[203] s://foundation.rust-lang.org)

See also
Comparison of programming languages
History of programming languages
List of programming languages
List of programming languages by type

Notes
1. Including build tools, host tools, and standard library support for x86-64, ARM, MIPS, RISC-
V, WebAssembly, i686, AArch64, PowerPC, and s390x.[2]
2. Including Windows, Linux, macOS, FreeBSD, NetBSD, and Illumos. Host build tools on
Android, iOS, Haiku, Redox, and Fuchsia are not officially shipped; these operating systems
are supported as targets.[2]
3. Third-party dependencies, e.g., LLVM or MSVC, are subject to their own licenses.[3][4]
4. The list of Rust compiler versions (referred to as a bootstrapping chain) has history going
back to 2012.[21]
5. Energy compared to C was 3% more for Rust and 34% more for C++; time was 4% more
and 56% more, respectively.
6. On Unix systems, this is often UTF-8 strings without an internal 0 byte. On Windows, this is
UTF-16 strings without an internal 0 byte. Unlike these, str and String are always valid
UTF-8 and can contain internal zeros.
7. That is, among respondents who have done "extensive development work [with Rust] in
over the past year" (12.6%), Rust had the largest percentage who also expressed interest to
"work in [Rust] over the next year" (82.2%).[192]

References

Book sources
Gjengset, Jon (2021). Rust for Rustaceans (https://www.worldcat.org/oclc/1277511986)
(1st ed.). No Starch Press. ISBN 9781718501850. OCLC 1277511986 (https://search.world
cat.org/oclc/1277511986).
Klabnik, Steve; Nichols, Carol (2019-08-12). The Rust Programming Language (Covers
Rust 2018) (https://books.google.com/books?id=0Vv6DwAAQBAJ). No Starch Press.
ISBN 978-1-7185-0044-0.
Blandy, Jim; Orendorff, Jason; Tindall, Leonora F. S. (2021). Programming Rust: Fast, Safe
Systems Development (https://www.worldcat.org/oclc/1289839504) (2nd ed.). O'Reilly
Media. ISBN 978-1-4920-5254-8. OCLC 1289839504 (https://search.worldcat.org/oclc/1289
839504).
McNamara, Tim (2021). Rust in Action (https://www.worldcat.org/oclc/1153044639).
Manning Publications. ISBN 978-1-6172-9455-6. OCLC 1153044639 (https://search.worldca
t.org/oclc/1153044639).
Klabnik, Steve; Nichols, Carol (2023). The Rust programming language (https://www.worldc
at.org/oclc/1363816350) (2nd ed.). No Starch Press. ISBN 978-1-7185-0310-6.
OCLC 1363816350 (https://search.worldcat.org/oclc/1363816350).

Others
1. "Announcing Rust 1.84.1 | Rust Blog" (https://blog.rust-lang.org/2025/01/30/Rust-1.84.1.htm
l). 2025-01-30. Retrieved 2025-02-03.
2. "Platform Support" (https://doc.rust-lang.org/rustc/platform-support.html). The rustc book.
Retrieved 2022-06-27.
3. "The Rust Programming Language" (https://github.com/rust-lang/rust/blob/master/COPYRIG
HT). The Rust Programming Language. 2022-10-19.
4. "Rust Legal Policies" (https://www.rust-lang.org/policies/licenses). Rust-lang.org. Archived (h
ttps://web.archive.org/web/20180404073350/https://www.rust-lang.org/en-US/legal.html)
from the original on 2018-04-04. Retrieved 2018-04-03.
5. "Uniqueness Types" (https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html).
Rust Blog. Retrieved 2016-10-08. "Those of you familiar with the Elm style may recognize
that the updated --explain messages draw heavy inspiration from the Elm approach."
6. "Influences - The Rust Reference" (https://doc.rust-lang.org/reference/influences.html). The
Rust Reference. Archived (https://web.archive.org/web/20231126231034/https://doc.rust-lan
g.org/reference/influences.html) from the original on 2023-11-26. Retrieved 2023-12-31.
7. "Uniqueness Types" (http://docs.idris-lang.org/en/latest/reference/uniqueness-types.html).
Idris 1.3.3 documentation. Retrieved 2022-07-14. "They are inspired by ... ownership types
and borrowed pointers in the Rust programming language."
8. "Microsoft opens up Rust-inspired Project Verona programming language on GitHub" (http
s://www.zdnet.com/article/microsoft-opens-up-rust-inspired-project-verona-programming-lan
guage-on-github/). ZDNet. Archived (https://web.archive.org/web/20200117143852/https://w
ww.zdnet.com/article/microsoft-opens-up-rust-inspired-project-verona-programming-languag
e-on-github/) from the original on 2020-01-17. Retrieved 2020-01-17.
9. Jaloyan, Georges-Axel (2017-10-19). "Safe Pointers in SPARK 2014". arXiv:1710.07047 (htt
ps://arxiv.org/abs/1710.07047) [cs.PL (https://arxiv.org/archive/cs.PL)].
10. Lattner, Chris. "Chris Lattner's Homepage" (http://nondot.org/sabre/). Nondot.org. Archived
(https://web.archive.org/web/20181225175312/http://nondot.org/sabre/) from the original on
2018-12-25. Retrieved 2019-05-14.
11. "V documentation (Introduction)" (https://github.com/vlang/v/blob/master/doc/docs.md#intro
duction). GitHub. Retrieved 2023-11-04.
12. Yegulalp, Serdar (2016-08-29). "New challenger joins Rust to topple C language" (https://ww
w.infoworld.com/article/3113083/new-challenger-joins-rust-to-upend-c-language.html).
InfoWorld. Retrieved 2022-10-19.
13. Eshwarla, Prabhu (2020-12-24). Practical System Programming for Rust Developers: Build
fast and secure software for Linux/Unix systems with the help of practical examples (https://
books.google.com/books?id=eEUREAAAQBAJ). Packt Publishing Ltd. ISBN 978-1-80056-
201-1.
14. Blanco-Cuaresma, Sergi; Bolmont, Emeline (2017-05-30). "What can the programming
language Rust do for astrophysics?" (https://www.cambridge.org/core/journals/proceedings-
of-the-international-astronomical-union/article/what-can-the-programming-language-rust-do-
for-astrophysics/B51B6DF72B7641F2352C05A502F3D881). Proceedings of the
International Astronomical Union. 12 (S325): 341–344. arXiv:1702.02951 (https://arxiv.org/a
bs/1702.02951). Bibcode:2017IAUS..325..341B (https://ui.adsabs.harvard.edu/abs/2017IAU
S..325..341B). doi:10.1017/S1743921316013168 (https://doi.org/10.1017%2FS1743921316
013168). ISSN 1743-9213 (https://search.worldcat.org/issn/1743-9213). S2CID 7857871 (htt
ps://api.semanticscholar.org/CorpusID:7857871).
15. Blandy, Orendorff & Tindall 2021.
16. Thompson, Clive (2023-02-14). "How Rust went from a side project to the world's most-
loved programming language" (https://www.technologyreview.com/2023/02/14/1067869/rust
-worlds-fastest-growing-programming-language/). MIT Technology Review. Retrieved
2023-02-23.
17. Klabnik, Steve (2016-06-02). "The History of Rust" (https://dl.acm.org/doi/10.1145/2959689.
2960081). Applicative 2016 on - Applicative 2016. New York, NY, USA: Association for
Computing Machinery. p. 80. doi:10.1145/2959689.2960081 (https://doi.org/10.1145%2F29
59689.2960081). ISBN 978-1-4503-4464-7.
18. Hoare, Graydon (July 2010). Project Servo: Technology from the past come to save the
future from itself (https://archive.today/20211226213836/http://venge.net/graydon/talks/intro-
talk-2.pdf) (PDF). Mozilla Annual Summit. Archived from the original (http://venge.net/graydo
n/talks/intro-talk-2.pdf) (PDF) on 2021-12-26. Retrieved 2024-10-29.
19. Hoare, Graydon (November 2016). "Rust Prehistory (Archive of the original Rust OCaml
compiler source code)" (https://github.com/graydon/rust-prehistory/tree/master). GitHub.
Retrieved 2024-10-29.
20. "0.1 first supported public release Milestone · rust-lang/rust" (https://github.com/rust-lang/rus
t/milestone/3?closed=1). GitHub. Retrieved 2024-10-29.
21. Nelson, Jynn (2022-08-05). RustConf 2022 - Bootstrapping: The once and future compiler
(https://www.youtube.com/watch?v=oUIjG-y4zaA). Portland, Oregon: Rust Team. Retrieved
2024-10-29 – via YouTube.
22. "Rust logo" (https://bugzilla.mozilla.org/show_bug.cgi?id=680521). bugzilla.mozilla.org.
Retrieved 2024-02-02.
23. "[rust-dev] The Rust compiler 0.1 is unleashed" (https://web.archive.org/web/201201241606
28/https://mail.mozilla.org/pipermail/rust-dev/2012-January/001256.html). 2012-01-24.
Archived from the original (https://mail.mozilla.org/pipermail/rust-dev/2012-January/001256.
html) on 2012-01-24. Retrieved 2025-01-07.
24. Anthony, Sebastian (2012-01-24). "Mozilla releases Rust 0.1, the language that will
eventually usurp Firefox's C++" (https://www.extremetech.com/internet/115207-mozilla-relea
ses-rust-0-1-the-language-that-will-eventually-usurp-firefoxs-c). ExtremeTech. Retrieved
2025-01-07.
25. "Purity by pcwalton · Pull Request #5412 · rust-lang/rust" (https://github.com/rust-lang/rust/p
ull/5412). GitHub. Retrieved 2024-10-29.
26. Binstock, Andrew (2014-01-07). "The Rise And Fall of Languages in 2013" (https://web.archi
ve.org/web/20160807075745/http://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-
2013/240165192). Dr. Dobb's Journal. Archived from the original (https://www.drdobbs.com/j
vm/the-rise-and-fall-of-languages-in-2013/240165192) on 2016-08-07. Retrieved
2022-11-20.
27. Lardinois, Frederic (2015-04-03). "Mozilla And Samsung Team Up To Develop Servo,
Mozilla's Next-Gen Browser Engine For Multicore Processors" (https://techcrunch.com/201
3/04/03/mozilla-and-samsung-collaborate-on-servo-mozillas-next-gen-browser-engine-for-to
morrows-multicore-processors/). TechCrunch. Archived (https://web.archive.org/web/201609
10211537/https://techcrunch.com/2013/04/03/mozilla-and-samsung-collaborate-on-servo-m
ozillas-next-gen-browser-engine-for-tomorrows-multicore-processors/) from the original on
2016-09-10. Retrieved 2017-06-25.
28. "Firefox 45.0, See All New Features, Updates and Fixes" (https://www.mozilla.org/en-US/fire
fox/45.0/releasenotes/). Mozilla. Retrieved 2024-10-31.
29. Lardinois, Frederic (2017-09-29). "It's time to give Firefox another chance" (https://techcrunc
h.com/2017/09/29/its-time-to-give-firefox-another-chance/). TechCrunch. Retrieved
2023-08-15.
30. Pereira, Rui; Couto, Marco; Ribeiro, Francisco; Rua, Rui; Cunha, Jácome; Fernandes, João
Paulo; Saraiva, João (2017-10-23). "Energy efficiency across programming languages: How
do energy, time, and memory relate?" (https://dl.acm.org/doi/10.1145/3136014.3136031).
Proceedings of the 10th ACM SIGPLAN International Conference on Software Language
Engineering. SLE 2017. New York, NY, USA: Association for Computing Machinery.
pp. 256–267. doi:10.1145/3136014.3136031 (https://doi.org/10.1145%2F3136014.313603
1). hdl:1822/65359 (https://hdl.handle.net/1822%2F65359). ISBN 978-1-4503-5525-4.
31. Cimpanu, Catalin (2020-08-11). "Mozilla lays off 250 employees while it refocuses on
commercial products" (https://www.zdnet.com/article/mozilla-lays-off-250-employees-while-it
-refocuses-on-commercial-products/). ZDNet. Archived (https://web.archive.org/web/202203
18025804/https://www.zdnet.com/article/mozilla-lays-off-250-employees-while-it-refocuses-o
n-commercial-products/) from the original on 2022-03-18. Retrieved 2020-12-02.
32. Cooper, Daniel (2020-08-11). "Mozilla lays off 250 employees due to the pandemic" (https://
www.engadget.com/mozilla-firefox-250-employees-layoffs-151324924.html). Engadget.
Archived (https://web.archive.org/web/20201213020220/https://www.engadget.com/mozilla-f
irefox-250-employees-layoffs-151324924.html) from the original on 2020-12-13. Retrieved
2020-12-02.
33. Tung, Liam. "Programming language Rust: Mozilla job cuts have hit us badly but here's how
we'll survive" (https://www.zdnet.com/article/programming-language-rust-mozilla-job-cuts-ha
ve-hit-us-badly-but-heres-how-well-survive/). ZDNet. Archived (https://web.archive.org/web/
20220421083509/https://www.zdnet.com/article/programming-language-rust-mozilla-job-cut
s-have-hit-us-badly-but-heres-how-well-survive/) from the original on 2022-04-21. Retrieved
2022-04-21.
34. "Laying the foundation for Rust's future" (https://blog.rust-lang.org/2020/08/18/laying-the-fou
ndation-for-rusts-future.html). Rust Blog. 2020-08-18. Archived (https://web.archive.org/web/
20201202022933/https://blog.rust-lang.org/2020/08/18/laying-the-foundation-for-rusts-futur
e.html) from the original on 2020-12-02. Retrieved 2020-12-02.
35. "Hello World!" (https://foundation.rust-lang.org/news/2021-02-08-hello-world/). Rust
Foundation. 2020-02-08. Archived (https://web.archive.org/web/20220419124635/https://fou
ndation.rust-lang.org/news/2021-02-08-hello-world/) from the original on 2022-04-19.
Retrieved 2022-06-04.
36. "Mozilla Welcomes the Rust Foundation" (https://blog.mozilla.org/blog/2021/02/08/mozilla-w
elcomes-the-rust-foundation). Mozilla Blog. 2021-02-09. Archived (https://web.archive.org/w
eb/20210208212031/https://blog.mozilla.org/blog/2021/02/08/mozilla-welcomes-the-rust-fou
ndation/) from the original on 2021-02-08. Retrieved 2021-02-09.
37. Amadeo, Ron (2021-04-07). "Google is now writing low-level Android code in Rust" (https://a
rstechnica.com/gadgets/2021/04/google-is-now-writing-low-level-android-code-in-rust/). Ars
Technica. Archived (https://web.archive.org/web/20210408001446/https://arstechnica.com/g
adgets/2021/04/google-is-now-writing-low-level-android-code-in-rust/) from the original on
2021-04-08. Retrieved 2021-04-08.
38. Anderson, Tim (2021-11-23). "Entire Rust moderation team resigns" (https://www.theregiste
r.com/2021/11/23/rust_moderation_team_quits/). The Register. Retrieved 2022-08-04.
39. "Governance Update" (https://blog.rust-lang.org/inside-rust/2022/05/19/governance-update.
html). Inside Rust Blog. Retrieved 2022-10-27.
40. Claburn, Thomas (2023-04-17). "Rust Foundation apologizes for trademark policy
confusion" (https://www.theregister.com/2023/04/17/rust_foundation_apologizes_trademark
_policy/). The Register. Retrieved 2023-05-07.
41. "White House urges developers to dump C and C++" (https://www.infoworld.com/article/233
6216/white-house-urges-developers-to-dump-c-and-c.html). InfoWorld. Retrieved
2025-01-26.
42. "After decades of memory-related software bugs, White House calls on industry to act" (http
s://therecord.media/memory-related-software-bugs-white-house-code-report-oncd).
therecord.media. Retrieved 2025-01-26.
43. Jack, Bobby (2024-02-29). "The White House Wants Memory-Safe Programming, but What
Is That?" (https://www.makeuseof.com/memory-safe-programming-white-house-wants/).
MUO. Retrieved 2025-01-26.
44. "In Rust we trust? White House Office urges memory safety - Stack Overflow" (https://stacko
verflow.blog/2024/12/30/in-rust-we-trust-white-house-office-urges-memory-safety/).
stackoverflow.blog. 2024-12-30. Retrieved 2025-01-26.
45. "Press Release: Future Software Should Be Memory Safe | ONCD" (https://web.archive.org/
web/20250118013136/https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/press-rel
ease-technical-report/). 2025-01-18. Archived from the original (https://www.whitehouse.gov/
oncd/briefing-room/2024/02/26/press-release-technical-report/) on 2025-01-18. Retrieved
2025-01-26.
46. Proven, Liam (2019-11-27). "Rebecca Rumbul named new CEO of The Rust Foundation" (h
ttps://www.theregister.com/2021/11/19/rust_foundation_ceo/). The Register. Retrieved
2022-07-14. "Both are curly bracket languages, with C-like syntax that makes them
unintimidating for C programmers."
47. Vigliarolo, Brandon (2021-02-10). "The Rust programming language now has its own
independent foundation" (https://web.archive.org/web/20230320172900/https://www.techrep
ublic.com/article/the-rust-programming-language-now-has-its-own-independent-foundatio
n/). TechRepublic. Archived from the original (https://www.techrepublic.com/article/the-rust-p
rogramming-language-now-has-its-own-independent-foundation/) on 2023-03-20. Retrieved
2022-07-14.
48. Klabnik & Nichols 2019, p. 263.
49. Klabnik & Nichols 2019, pp. 5–6.
50. Klabnik & Nichols 2023, p. 32.
51. Klabnik & Nichols 2023, pp. 32–33.
52. Klabnik & Nichols 2023, pp. 49–50.
53. Klabnik & Nichols 2023, pp. 34–36.
54. Klabnik & Nichols 2023, pp. 6, 47, 53.
55. Klabnik & Nichols 2023, pp. 47–48.
56. Klabnik & Nichols 2023, pp. 50–53.
57. Klabnik & Nichols 2023, p. 56.
58. Klabnik & Nichols 2023, pp. 57–58.
59. Klabnik & Nichols 2023, pp. 54–56.
60. Klabnik & Nichols 2019, pp. 104–109.
61. Klabnik & Nichols 2019, pp. 24.
62. Klabnik & Nichols 2019, pp. 36–38.
63. Klabnik & Nichols 2023, pp. 36–38.
64. Klabnik & Nichols 2023, p. 502.
65. "Glossary of Unicode Terms" (https://www.unicode.org/glossary/). Unicode Consortium.
Retrieved 2024-07-30.
66. Klabnik & Nichols 2019, pp. 38–40.
67. Klabnik & Nichols 2019, p. 83.
68. Klabnik & Nichols 2019, p. 97.
69. Klabnik & Nichols 2019, pp. 98–101.
70. Klabnik & Nichols 2019, pp. 438–440.
71. Klabnik & Nichols 2019, pp. 93.
72. "OsStr in std::ffi – Rust" (https://doc.rust-lang.org/beta/std/ffi/struct.OsStr.html). doc.rust-
lang.org. Retrieved 2023-10-02.
73. "OsString in std::ffi – Rust" (https://doc.rust-lang.org/beta/std/ffi/struct.OsString.html).
doc.rust-lang.org. Retrieved 2023-10-02.
74. "Path in std::path – Rust" (https://doc.rust-lang.org/beta/std/path/struct.Path.html). doc.rust-
lang.org. Retrieved 2023-10-02.
75. "PathBuf in std::path – Rust" (https://doc.rust-lang.org/beta/std/path/struct.PathBuf.html).
doc.rust-lang.org. Retrieved 2023-10-02.
76. "std::boxed – Rust" (https://doc.rust-lang.org/std/boxed/index.html). doc.rust-lang.org.
Retrieved 2023-06-23.
77. "std::boxed – Rust" (https://doc.rust-lang.org/std/boxed/index.html). doc.rust-lang.org.
Retrieved 2023-06-24.
78. "Rc in std::rc – Rust" (https://doc.rust-lang.org/beta/std/rc/struct.Rc.html). doc.rust-lang.org.
Retrieved 2023-06-24.
79. "Arc in std::sync – Rust" (https://doc.rust-lang.org/beta/std/sync/struct.Arc.html). doc.rust-
lang.org. Retrieved 2023-06-24.
80. "Cell in std::cell – Rust" (https://doc.rust-lang.org/beta/std/cell/struct.Cell.html#). doc.rust-
lang.org. Retrieved 2023-06-24.
81. "Mutex in std::sync – Rust" (https://doc.rust-lang.org/beta/std/sync/struct.Mutex.html).
doc.rust-lang.org. Retrieved 2023-06-24.
82. "RwLock in std::sync – Rust" (https://doc.rust-lang.org/beta/std/sync/struct.RwLock.html).
doc.rust-lang.org. Retrieved 2023-06-24.
83. "Condvar in std::sync – Rust" (https://doc.rust-lang.org/beta/std/sync/struct.Condvar.html).
doc.rust-lang.org. Retrieved 2023-06-24.
84. "Duration in std::time – Rust" (https://doc.rust-lang.org/beta/std/time/struct.Duration.html).
doc.rust-lang.org. Retrieved 2023-06-24.
85. "HashMap in std::collections – Rust" (https://doc.rust-lang.org/beta/std/collections/struct.Has
hMap.html). doc.rust-lang.org. Retrieved 2023-06-24.
86. "BTreeMap in std::collections – Rust" (https://doc.rust-lang.org/beta/std/collections/struct.BT
reeMap.html). doc.rust-lang.org. Retrieved 2023-06-24.
87. McNamara 2021.
88. Klabnik & Nichols 2019, pp. 101–104.
89. "std::option - Rust" (https://doc.rust-lang.org/std/option/index.html#representation). doc.rust-
lang.org. Retrieved 2023-11-12.
90. Klabnik & Nichols 2019, pp. 418–427.
91. "Casting - Rust By Example" (https://doc.rust-lang.org/rust-by-example/types/cast.html).
doc.rust-lang.org.
92. Klabnik & Nichols 2019, pp. 59–61.
93. Klabnik & Nichols 2019, pp. 63–68.
94. Klabnik & Nichols 2019, pp. 74–75.
95. Balasubramanian, Abhiram; Baranowski, Marek S.; Burtsev, Anton; Panda, Aurojit;
Rakamarić, Zvonimir; Ryzhyk, Leonid (2017-05-07). "System Programming in Rust" (https://
doi.org/10.1145/3102980.3103006). Proceedings of the 16th Workshop on Hot Topics in
Operating Systems. HotOS '17. New York, NY, US: Association for Computing Machinery.
pp. 156–161. doi:10.1145/3102980.3103006 (https://doi.org/10.1145%2F3102980.310300
6). ISBN 978-1-4503-5068-6. S2CID 24100599 (https://api.semanticscholar.org/CorpusID:2
4100599). Archived (https://web.archive.org/web/20220611034046/https://dl.acm.org/doi/10.
1145/3102980.3103006) from the original on 2022-06-11. Retrieved 2022-06-01.
96. Klabnik & Nichols 2023, pp. 327–30.
97. "Lifetimes - Rust By Example" (https://doc.rust-lang.org/rust-by-example/scope/lifetime.htm
l). doc.rust-lang.org. Retrieved 2024-10-29.
98. "Explicit annotation - Rust By Example" (https://doc.rust-lang.org/rust-by-example/scope/lifet
ime/explicit.html). doc.rust-lang.org. Retrieved 2024-10-29.
99. Klabnik & Nichols 2019, p. 194.
100. Klabnik & Nichols 2019, pp. 75, 134.
101. Shamrell-Harrington, Nell. "The Rust Borrow Checker – a Deep Dive" (https://www.infoq.co
m/presentations/rust-borrow-checker/). InfoQ. Retrieved 2022-06-25.
102. Klabnik & Nichols 2019, pp. 194–195.
103. Klabnik & Nichols 2023, pp. 208–12.
104. Klabnik & Nichols 2019, pp. 201–203.
105. "References and Borrowing - The Rust Programming Language" (https://doc.rust-lang.org/b
ook/ch04-02-references-and-borrowing.html). doc.rust-lang.org. Retrieved 2024-10-29.
106. Pearce, David (2021-04-17). "A Lightweight Formalism for Reference Lifetimes and
Borrowing in Rust" (https://dl.acm.org/doi/10.1145/3443420). ACM Transactions on
Programming Languages and Systems. 43: 1–73. doi:10.1145/3443420 (https://doi.org/10.1
145%2F3443420). Archived (https://web.archive.org/web/20240415053627/https://dl.acm.or
g/doi/10.1145/3443420) from the original on 2024-04-15. Retrieved 2024-12-11.
107. Klabnik & Nichols 2019, pp. 171–172.
108. Klabnik & Nichols 2019, pp. 171–172, 205.
109. Klabnik & Nichols 2019, pp. 181, 182.
110. Gjengset 2021, p. 25.
111. Klabnik & Nichols 2019, pp. 182–184.
112. Klabnik & Nichols 2019, pp. 281–283.
113. "Using Trait Objects That Allow for Values of Different Types – The Rust Programming
Language" (https://doc.rust-lang.org/book/ch17-02-trait-objects.html). doc.rust-lang.org.
Retrieved 2022-07-11.
114. Klabnik & Nichols 2019, pp. 441–442.
115. Klabnik & Nichols 2019, pp. 379–380.
116. Rosenblatt, Seth (2013-04-03). "Samsung joins Mozilla's quest for Rust" (http://reviews.cnet.
com/8301-3514_7-57577639/samsung-joins-mozillas-quest-for-rust/). CNET. Archived (http
s://web.archive.org/web/20130404142333/http://reviews.cnet.com/8301-3514_7-57577639/s
amsung-joins-mozillas-quest-for-rust/) from the original on 2013-04-04. Retrieved
2013-04-05.
117. Brown, Neil (2013-04-17). "A taste of Rust" (https://lwn.net/Articles/547145/). LWN.net.
Archived (https://web.archive.org/web/20130426010754/http://lwn.net/Articles/547145/) from
the original on 2013-04-26. Retrieved 2013-04-25.
118. "Races – The Rustonomicon" (https://doc.rust-lang.org/nomicon/races.html). doc.rust-
lang.org. Archived (https://web.archive.org/web/20170710194643/https://doc.rust-lang.org/n
omicon/races.html) from the original on 2017-07-10. Retrieved 2017-07-03.
119. Vandervelden, Thibaut; De Smet, Ruben; Deac, Diana; Steenhaut, Kris; Braeken, An (2024-
09-07). "Overview of Embedded Rust Operating Systems and Frameworks" (https://www.nc
bi.nlm.nih.gov/pmc/articles/PMC11398098). MDPI. 24 (17). Sensors: 5818.
Bibcode:2024Senso..24.5818V (https://ui.adsabs.harvard.edu/abs/2024Senso..24.5818V).
doi:10.3390/s24175818 (https://doi.org/10.3390%2Fs24175818). PMC 11398098 (https://w
ww.ncbi.nlm.nih.gov/pmc/articles/PMC11398098). PMID 39275729 (https://pubmed.ncbi.nl
m.nih.gov/39275729).
120. "The Rust Language FAQ" (https://web.archive.org/web/20150420104147/http://static.rust-la
ng.org/doc/master/complement-lang-faq.html). static.rust-lang.org. 2015. Archived from the
original (http://static.rust-lang.org/doc/master/complement-lang-faq.html) on 2015-04-20.
Retrieved 2017-04-24.
121. McNamara 2021, p. 139, 376–379, 395.
122. "RAII – Rust By Example" (https://doc.rust-lang.org/rust-by-example/scope/raii.html).
doc.rust-lang.org. Archived (https://web.archive.org/web/20190421131142/https://doc.rust-la
ng.org/rust-by-example/scope/raii.html) from the original on 2019-04-21. Retrieved
2020-11-22.
123. "Abstraction without overhead: traits in Rust" (https://blog.rust-lang.org/2015/05/11/traits.htm
l). Rust Blog. Archived (https://web.archive.org/web/20210923101530/https://blog.rust-lang.
org/2015/05/11/traits.html) from the original on 2021-09-23. Retrieved 2021-10-19.
124. "Box, stack and heap" (https://doc.rust-lang.org/stable/rust-by-example/std/box.html). Rust
By Example. Retrieved 2022-06-13.
125. Klabnik & Nichols 2019, pp. 70–75.
126. Klabnik & Nichols 2019, p. 323.
127. Klabnik & Nichols 2023, pp. 449–455.
128. Gjengset 2021, pp. 101–102.
129. "Macros By Example" (https://doc.rust-lang.org/reference/macros-by-example.html). The
Rust Reference. Retrieved 2023-04-21.
130. Klabnik & Nichols 2019, pp. 446–448.
131. "Procedural Macros" (https://doc.rust-lang.org/reference/procedural-macros.html). The Rust
Programming Language Reference. Archived (https://web.archive.org/web/2020110723344
4/https://doc.rust-lang.org/reference/procedural-macros.html) from the original on 2020-11-
07. Retrieved 2021-03-23.
132. Klabnik & Nichols 2019, pp. 449–455.
133. "Safe Interoperability between Rust and C++ with CXX" (https://www.infoq.com/news/2020/1
2/cpp-rust-interop-cxx/). InfoQ. 2020-12-06. Archived (https://web.archive.org/web/2021012
2142035/https://www.infoq.com/news/2020/12/cpp-rust-interop-cxx/) from the original on
2021-01-22. Retrieved 2021-01-03.
134. "Type layout – The Rust Reference" (https://doc.rust-lang.org/reference/type-layout.html#the
-c-representation). doc.rust-lang.org. Retrieved 2022-07-15.
135. Blandy, Orendorff & Tindall 2021, pp. 6–8.
136. "Overview of the compiler" (https://rustc-dev-guide.rust-lang.org/overview.html). Rust
Compiler Development Guide. Rust project contributors. Retrieved 2024-11-07.
137. "Code Generation - Rust Compiler Development Guide" (https://rustc-dev-guide.rust-lang.or
g/backend/codegen.html). rustc-dev-guide.rust-lang.org. Retrieved 2024-03-03.
138. "rust-lang/rustc_codegen_gcc" (https://github.com/rust-lang/rustc_codegen_gcc#Motivatio
n). GitHub. The Rust Programming Language. 2024-03-02. Retrieved 2024-03-03.
139. "rust-lang/rustc_codegen_cranelift" (https://github.com/rust-lang/rustc_codegen_cranelift).
GitHub. The Rust Programming Language. 2024-03-02. Retrieved 2024-03-03.
140. Gjengset 2021, p. 213-215.
141. Perkel, Jeffrey M. (2020-12-01). "Why scientists are turning to Rust" (https://www.nature.co
m/articles/d41586-020-03382-2). Nature. 588 (7836): 185–186.
Bibcode:2020Natur.588..185P (https://ui.adsabs.harvard.edu/abs/2020Natur.588..185P).
doi:10.1038/d41586-020-03382-2 (https://doi.org/10.1038%2Fd41586-020-03382-2).
PMID 33262490 (https://pubmed.ncbi.nlm.nih.gov/33262490). S2CID 227251258 (https://ap
i.semanticscholar.org/CorpusID:227251258). Archived (https://web.archive.org/web/202205
06040523/https://www.nature.com/articles/d41586-020-03382-2) from the original on 2022-
05-06. Retrieved 2022-05-15.
142. Simone, Sergio De (2019-04-18). "Rust 1.34 Introduces Alternative Registries for Non-
Public Crates" (https://www.infoq.com/news/2019/04/rust-1.34-additional-registries). InfoQ.
Retrieved 2022-07-14.
143. Klabnik & Nichols 2019, pp. 511–512.
144. Clippy (https://github.com/rust-lang/rust-clippy), The Rust Programming Language, 2023-11-
30, retrieved 2023-11-30
145. "Clippy Lints" (https://rust-lang.github.io/rust-clippy/master/index.html). The Rust
Programming Language. Retrieved 2023-11-30.
146. Klabnik & Nichols 2019, Appendix G – How Rust is Made and "Nightly Rust"
147. Blandy, Orendorff & Tindall 2021, pp. 176–177.
148. Klabnik & Nichols 2023, p. 623.
149. McNamara 2021, p. 11.
150. Popescu, Natalie; Xu, Ziyang; Apostolakis, Sotiris; August, David I.; Levy, Amit (2021-10-15).
"Safer at any speed: automatic context-aware safety enhancement for Rust" (https://doi.org/
10.1145%2F3485480). Proceedings of the ACM on Programming Languages. 5 (OOPSLA).
Section 2. doi:10.1145/3485480 (https://doi.org/10.1145%2F3485480). S2CID 238212612
(https://api.semanticscholar.org/CorpusID:238212612). p. 5: "We observe a large variance
in the overheads of checked indexing: 23.6% of benchmarks do report significant
performance hits from checked indexing, but 64.5% report little-to-no impact and,
surprisingly, 11.8% report improved performance ... Ultimately, while unchecked indexing
can improve performance, most of the time it does not."
151. Anderson, Tim. "Can Rust save the planet? Why, and why not" (https://www.theregister.com/
2021/11/30/aws_reinvent_rust/). The Register. Retrieved 2022-07-11.
152. Yegulalp, Serdar (2021-10-06). "What is the Rust language? Safe, fast, and easy software
development" (https://www.infoworld.com/article/3218074/what-is-rust-safe-fast-and-easy-so
ftware-development.html). InfoWorld. Retrieved 2022-06-25.
153. Astrauskas, Vytautas; Matheja, Christoph; Poli, Federico; Müller, Peter; Summers,
Alexander J. (2020-11-13). "How do programmers use unsafe rust?" (https://dl.acm.org/doi/
10.1145/3428204). Proceedings of the ACM on Programming Languages. 4 (OOPSLA): 1–
27. doi:10.1145/3428204 (https://doi.org/10.1145%2F3428204). hdl:20.500.11850/465785
(https://hdl.handle.net/20.500.11850%2F465785). ISSN 2475-1421 (https://search.worldcat.
org/issn/2475-1421).
154. McNamara 2021, p. 19, 27.
155. Couprie, Geoffroy (2015). "Nom, A Byte oriented, streaming, Zero copy, Parser Combinators
Library in Rust" (https://ieeexplore.ieee.org/document/7163218). 2015 IEEE Security and
Privacy Workshops. pp. 142–148. doi:10.1109/SPW.2015.31 (https://doi.org/10.1109%2FSP
W.2015.31). ISBN 978-1-4799-9933-0. S2CID 16608844 (https://api.semanticscholar.org/Co
rpusID:16608844).
156. McNamara 2021, p. 20.
157. "Code generation – The Rust Reference" (https://doc.rust-lang.org/reference/attributes/code
gen.html). doc.rust-lang.org. Retrieved 2022-10-09.
158. "How Fast Is Rust?" (https://doc.rust-lang.org/1.0.0/complement-lang-faq.html#how-fast-is-r
ust?). The Rust Programming Language FAQ. Archived (https://web.archive.org/web/20201
028102013/https://doc.rust-lang.org/1.0.0/complement-lang-faq.html#how-fast-is-rust?) from
the original on 2020-10-28. Retrieved 2019-04-11.
159. Farshin, Alireza; Barbette, Tom; Roozbeh, Amir; Maguire Jr, Gerald Q.; Kostić, Dejan (2021).
"PacketMill: Toward per-Core 100-GBPS networking". Proceedings of the 26th ACM
International Conference on Architectural Support for Programming Languages and
Operating Systems (https://dlnext.acm.org/doi/abs/10.1145/3445814.3446724). pp. 1–17.
doi:10.1145/3445814.3446724 (https://doi.org/10.1145%2F3445814.3446724).
ISBN 9781450383172. S2CID 231949599 (https://api.semanticscholar.org/CorpusID:23194
9599). Retrieved 2022-07-12. "... While some compilers (e.g., Rust) support structure
reordering [82], C & C++ compilers are forbidden to reorder data structures (e.g., struct or
class) [74] ..."
160. "Type layout" (https://doc.rust-lang.org/reference/type-layout.html). The Rust Reference.
Retrieved 2022-07-14.
161. Keizer, Gregg (2016-10-31). "Mozilla plans to rejuvenate Firefox in 2017" (https://www.comp
uterworld.com/article/3137050/mozilla-plans-to-rejuvenate-firefox-in-2017.html).
Computerworld. Retrieved 2023-05-13.
162. Claburn, Thomas (2023-01-12). "Google polishes Chromium code with a layer of Rust" (http
s://www.theregister.com/2023/01/12/google_chromium_rust/). The Register. Retrieved
2024-07-17.
163. "Supporting the Use of Rust in the Chromium Project" (https://security.googleblog.com/2023/
01/supporting-use-of-rust-in-chromium.html). Google Online Security Blog. Retrieved
2023-11-12.
164. Shankland, Stephen (2016-07-12). "Firefox will get overhaul in bid to get you interested
again" (https://www.cnet.com/tech/services-and-software/firefox-mozilla-gets-overhaul-in-a-b
id-to-get-you-interested-again/). CNET. Retrieved 2022-07-14.
165. Security Research Team (2013-10-04). "ZeroMQ: Helping us Block Malicious Domains in
Real Time" (https://web.archive.org/web/20230513161542/https://umbrella.cisco.com/blog/z
eromq-helping-us-block-malicious-domains). Cisco Umbrella. Archived from the original (htt
ps://umbrella.cisco.com/blog/zeromq-helping-us-block-malicious-domains) on 2023-05-13.
Retrieved 2023-05-13.
166. Cimpanu, Catalin (2019-10-15). "AWS to sponsor Rust project" (https://www.zdnet.com/articl
e/aws-to-sponsor-rust-project/). ZDNET. Retrieved 2024-07-17.
167. Nichols, Shaun (2018-06-27). "Microsoft's next trick? Kicking things out of the cloud to Azure
IoT Edge" (https://www.theregister.co.uk/2018/06/27/microsofts_next_cloud_trick_kicking_th
ings_out_of_the_cloud_to_azure_iot_edge/). The Register. Archived (https://web.archive.or
g/web/20190927092433/https://www.theregister.co.uk/2018/06/27/microsofts_next_cloud_tri
ck_kicking_things_out_of_the_cloud_to_azure_iot_edge/) from the original on 2019-09-27.
Retrieved 2019-09-27.
168. Tung, Liam. "Microsoft: Why we used programming language Rust over Go for
WebAssembly on Kubernetes app" (https://www.zdnet.com/article/microsoft-why-we-used-pr
ogramming-language-rust-over-go-for-webassembly-on-kubernetes-app/). ZDNet. Archived
(https://web.archive.org/web/20220421043549/https://www.zdnet.com/article/microsoft-why-
we-used-programming-language-rust-over-go-for-webassembly-on-kubernetes-app/) from
the original on 2022-04-21. Retrieved 2022-04-21.
169. Claburn, Thomas (2022-09-20). "In Rust We Trust: Microsoft Azure CTO shuns C and C++"
(https://www.theregister.com/2022/09/20/rust_microsoft_c/). The Register. Retrieved
2024-07-07.
170. Simone, Sergio De. "NPM Adopted Rust to Remove Performance Bottlenecks" (https://www.
infoq.com/news/2019/03/rust-npm-performance/). InfoQ. Retrieved 2023-11-20.
171. Lyu, Shing (2020), Lyu, Shing (ed.), "Welcome to the World of Rust" (https://doi.org/10.1007/
978-1-4842-5599-5_1), Practical Rust Projects: Building Game, Physical Computing, and
Machine Learning Applications, Berkeley, CA: Apress, pp. 1–8, doi:10.1007/978-1-4842-
5599-5_1 (https://doi.org/10.1007%2F978-1-4842-5599-5_1), ISBN 978-1-4842-5599-5,
retrieved 2023-11-29
172. Lyu, Shing (2021), Lyu, Shing (ed.), "Rust in the Web World" (https://doi.org/10.1007/978-1-
4842-6589-5_1), Practical Rust Web Projects: Building Cloud and Web-Based Applications,
Berkeley, CA: Apress, pp. 1–7, doi:10.1007/978-1-4842-6589-5_1 (https://doi.org/10.1007%
2F978-1-4842-6589-5_1), ISBN 978-1-4842-6589-5, retrieved 2023-11-29
173. "An Empirical Study of Rust-for-Linux: The Success, Dissatisfaction, and Compromise" (http
s://www.usenix.org/publications/loginonline/empirical-study-rust-linux-success-dissatisfactio
n-and-compromise). USENIX. 2024-06-30. Retrieved 2024-11-28.
174. "A first look at Rust in the 6.1 kernel [LWN.net]" (https://lwn.net/Articles/910762/). lwn.net.
Retrieved 2023-11-11.
175. Vaughan-Nichols, Steven (2021-12-07). "Rust takes a major step forward as Linux's second
official language" (https://www.zdnet.com/article/rust-takes-a-major-step-forward-as-linuxs-s
econd-official-language/). ZDNET. Retrieved 2024-11-27.
176. "Rust in the 6.2 kernel [LWN.net]" (https://lwn.net/Articles/914458/). lwn.net. Retrieved
2024-11-28.
177. "Committing to Rust in the kernel [LWN.net]" (https://lwn.net/Articles/991062/). lwn.net.
Retrieved 2024-11-28.
178. Amadeo, Ron (2021-04-07). "Google is now writing low-level Android code in Rust" (https://a
rstechnica.com/gadgets/2021/04/google-is-now-writing-low-level-android-code-in-rust/). Ars
Technica. Archived (https://web.archive.org/web/20210408001446/https://arstechnica.com/g
adgets/2021/04/google-is-now-writing-low-level-android-code-in-rust/) from the original on
2021-04-08. Retrieved 2022-04-21.
179. Darkcrizt (2021-04-02). "Google Develops New Bluetooth Stack for Android, Written in Rust"
(https://web.archive.org/web/20210825165930/https://blog.desdelinux.net/en/google-develo
ps-a-new-bluetooth-stack-for-android-written-in-rust/). Desde Linux. Archived from the
original (https://blog.desdelinux.net/en/google-develops-a-new-bluetooth-stack-for-android-
written-in-rust/) on 2021-08-25. Retrieved 2024-08-31.
180. Claburn, Thomas (2023-04-27). "Microsoft is rewriting core Windows libraries in Rust" (http
s://www.theregister.com/2023/04/27/microsoft_windows_rust/). The Register. Retrieved
2023-05-13.
181. Proven, Liam. "Small but mighty, 9Front's 'Humanbiologics' is here for the truly curious" (http
s://www.theregister.com/2023/12/01/9front_humanbiologics/). The Register. Retrieved
2024-03-07.
182. Yegulalp, Serdar. "Rust's Redox OS could show Linux a few new tricks" (http://www.infoworl
d.com/article/3046100/open-source-tools/rusts-redox-os-could-show-linux-a-few-new-tricks.
html). InfoWorld. Archived (https://web.archive.org/web/20160321192838/http://www.infowor
ld.com/article/3046100/open-source-tools/rusts-redox-os-could-show-linux-a-few-new-tricks.
html) from the original on 2016-03-21. Retrieved 2016-03-21.
183. Anderson, Tim (2021-01-14). "Another Rust-y OS: Theseus joins Redox in pursuit of safer,
more resilient systems" (https://www.theregister.com/2021/01/14/rust_os_theseus/). The
Register. Retrieved 2022-07-14.
184. Boos, Kevin; Liyanage, Namitha; Ijaz, Ramla; Zhong, Lin (2020). Theseus: an Experiment in
Operating System Structure and State Management (https://www.usenix.org/conference/osd
i20/presentation/boos). pp. 1–19. ISBN 978-1-939133-19-9.
185. Zhang, HanDong (Alex) (2023-01-31). "2022 Review | The adoption of Rust in Business" (htt
ps://rustmagazine.org/issue-1/2022-review-the-adoption-of-rust-in-business/). Rust
Magazine. Retrieved 2023-02-07.
186. Sei, Mark (2018-10-10). "Fedora 29 new features: Startis now officially in Fedora" (https://w
ww.marksei.com/fedora-29-new-features-startis/). Marksei, Weekly sysadmin pills. Archived
(https://web.archive.org/web/20190413075055/https://www.marksei.com/fedora-29-new-feat
ures-startis/) from the original on 2019-04-13. Retrieved 2019-05-13.
187. Proven, Liam (2022-07-12). "Oracle Linux 9 released, with some interesting additions" (http
s://www.theregister.com/2022/07/12/oracle_linux_9/). The Register. Retrieved 2022-07-14.
188. Proven, Liam (2023-02-02). "System76 teases features coming in homegrown Rust-based
desktop COSMIC" (https://www.theregister.com/2023/02/02/system76_cosmic_xfce_update
s/). The Register. Retrieved 2024-07-17.
189. Hu, Vivian (2020-06-12). "Deno Is Ready for Production" (https://www.infoq.com/news/2020/
06/deno-1-ready-production/). InfoQ. Retrieved 2022-07-14.
190. Abrams, Lawrence (2021-02-06). "This Flash Player emulator lets you securely play your
old games" (https://www.bleepingcomputer.com/news/software/this-flash-player-emulator-let
s-you-securely-play-your-old-games/). BleepingComputer. Retrieved 2021-12-25.
191. Kharif, Olga (2020-10-17). "Ethereum Blockchain Killer Goes By Unassuming Name of
Polkadot" (https://www.bloomberg.com/news/articles/2020-10-17/ethereum-blockchain-killer
-goes-by-unassuming-name-of-polkadot). Bloomberg L.P. Retrieved 2021-07-14.
192. "2024 Stack Overflow Developer Survey - Technology" (https://survey.stackoverflow.co/202
4/technology). Stack Overflow. Retrieved 2024-11-28.
193. Claburn, Thomas (2022-06-23). "Linus Torvalds says Rust is coming to the Linux kernel" (htt
ps://www.theregister.com/2022/06/23/linus_torvalds_rust_linux_kernel/). The Register.
Retrieved 2022-07-15.
194. Jung, Ralf; Jourdan, Jacques-Henri; Krebbers, Robbert; Dreyer, Derek (2017-12-27).
"RustBelt: securing the foundations of the Rust programming language" (https://dl.acm.org/d
oi/10.1145/3158154). Proceedings of the ACM on Programming Languages. 2 (POPL): 1–
34. doi:10.1145/3158154 (https://doi.org/10.1145%2F3158154). hdl:21.11116/0000-0003-
34C6-3 (https://hdl.handle.net/21.11116%2F0000-0003-34C6-3). ISSN 2475-1421 (https://s
earch.worldcat.org/issn/2475-1421).
195. Popescu, Natalie; Xu, Ziyang; Apostolakis, Sotiris; August, David I.; Levy, Amit (2021-10-20).
"Safer at any speed: automatic context-aware safety enhancement for Rust" (https://doi.org/
10.1145%2F3485480). Proceedings of the ACM on Programming Languages. 5 (OOPSLA):
1–23. doi:10.1145/3485480 (https://doi.org/10.1145%2F3485480). ISSN 2475-1421 (https://
search.worldcat.org/issn/2475-1421).
196. Klabnik & Nichols 2019, p. 4.
197. "Getting Started" (https://www.rust-lang.org/learn/get-started#ferris). rust-lang.org. Archived
(https://web.archive.org/web/20201101145703/https://www.rust-lang.org/learn/get-started#fe
rris) from the original on 2020-11-01. Retrieved 2020-10-11.
198. Tung, Liam (2021-02-08). "The Rust programming language just took a huge step forwards"
(https://www.zdnet.com/article/the-rust-programming-language-just-took-a-huge-step-forwar
ds/). ZDNet. Retrieved 2022-07-14.
199. Krill, Paul. "Rust language moves to independent foundation" (https://www.infoworld.com/art
icle/3606774/rust-language-moves-to-independent-foundation.html). InfoWorld. Archived (htt
ps://web.archive.org/web/20210410161528/https://www.infoworld.com/article/3606774/rust-l
anguage-moves-to-independent-foundation.html) from the original on 2021-04-10. Retrieved
2021-04-10.
200. Vaughan-Nichols, Steven J. (2021-04-09). "AWS's Shane Miller to head the newly created
Rust Foundation" (https://www.zdnet.com/article/awss-shane-miller-to-head-the-newly-creat
ed-rust-foundation/). ZDNet. Archived (https://web.archive.org/web/20210410031305/https://
www.zdnet.com/article/awss-shane-miller-to-head-the-newly-created-rust-foundation/) from
the original on 2021-04-10. Retrieved 2021-04-10.
201. Vaughan-Nichols, Steven J. (2021-11-17). "Rust Foundation appoints Rebecca Rumbul as
executive director" (https://www.zdnet.com/article/rust-foundation-appoints-rebecca-rumbul-
as-executive-director/). ZDNet. Archived (https://web.archive.org/web/20211118062346/http
s://www.zdnet.com/article/rust-foundation-appoints-rebecca-rumbul-as-executive-director/)
from the original on 2021-11-18. Retrieved 2021-11-18.
202. "Governance" (https://www.rust-lang.org/governance). The Rust Programming Language.
Archived (https://web.archive.org/web/20220510225505/https://www.rust-lang.org/governan
ce) from the original on 2022-05-10. Retrieved 2024-07-18.
203. "Introducing the Rust Leadership Council" (https://blog.rust-lang.org/2023/06/20/introducing-
leadership-council.html). Rust Blog. Retrieved 2024-01-12.

External links
Official website (https://www.rust-lang.org/)
Source code (https://github.com/rust-lang/rust) on GitHub

Retrieved from "https://en.wikipedia.org/w/index.php?title=Rust_(programming_language)&oldid=1275900067"

You might also like