Paradigms | Multi-paradigm: concurrent, functional, generic, imperative, structured |
---|---|
Designed by | Graydon Hoare |
First appeared | July 7, 2010 |
Stable release | 1.62.0[1]
/ June 30, 2022 |
Typing discipline | Affine, inferred, nominal, static, strong |
Implementation language | Rust |
Platform | Cross-platform[2][note 1] |
OS | Cross-platform[2][note 2] |
License | MIT and Apache 2.0 (dual-licensed) [3] |
Filename extensions | .rs , .rlib |
Website | www |
Influenced by | |
Influenced | |
Rust is a multi-paradigm, general-purpose programming language. Rust emphasizes performance, type safety, and concurrency.[13][14][15] Rust enforces memory safety — that is, that all references point to valid memory — without requiring the use of a garbage collector or reference counting present in other memory-safe languages.[15][16] To simultaneously enforce memory safety and prevent concurrent data races, Rust's borrow checker tracks the object lifetime and variable scope of all references in a program during compilation.[17] Rust is popular for systems programming[15] but also offers high-level features including functional programming constructs.[18]
Software developer Graydon Hoare designed Rust while working at Mozilla Research in 2006.[19][20] Mozilla officially sponsored the project in 2009, and the designers refined the language while writing the Servo experimental browser engine[21] and the Rust compiler. Rust's major influences include C++, Cyclone, Erlang, Haskell, and OCaml.[6] Since the first stable release in January 2014, Rust has been adopted by companies including Amazon,[22][23] Discord,[24] Dropbox,[25] Facebook (Meta),[26] Google (Alphabet),[27][28] and Microsoft.[29][30]
Rust has been noted for its growth as a newer language[14][31] and has been the subject of academic programming languages research.[32][33][34][15] According to the Stack Overflow Developer Survey in 2022, 9% of respondents have recently done extensive development in Rust.[35] The survey has additionally named Rust the "most loved programming language" every year between 2016 and 2022 (inclusive), a ranking based on the number of current developers who express an interest in continuing to work in the same language.[note 4] In 2022, Rust tied with Python for "most wanted technology" with 18% of developers not currently working in Rust expressing an interest in doing so.[35]
History
Early origins (2006–2012)
Rust grew out of a personal project begun in 2006 by Mozilla employee Graydon Hoare.[36][37]
Mozilla began sponsoring the project in 2009[36] and officially announced the project in 2010.[38][39] During the same year, work had shifted from the initial compiler written in OCaml to a self-hosting compiler based on LLVM written in Rust. The new Rust compiler, named rustc, successfully compiled itself in 2011.[40]
On Internet Relay Chat, Hoare has stated that Rust got its name in part from rust fungi and as a subsequence of "robust".[41]
The first numbered pre-alpha version of the compiler, Rust 0.1, was released in January 2012.[42]
Evolution (2013–2019)
Rust's object system, used for object-oriented programming, changed considerably between versions 0.2, 0.3, and 0.4 of Rust. Version 0.2 introduced classes for the first time,[43] and version 0.3 added destructors and polymorphism through the use of interfaces.[44] In Rust 0.4, traits were added as a means to provide inheritance; interfaces were unified with traits and removed as a separate feature. Classes were also removed and replaced by a combination of implementations and structured types.[45]
Along with conventional static typing, before version 0.4, Rust also supported typestate analysis through contracts. It was removed in release 0.4, though the same functionality can be achieved by leveraging Rust's type system.[46]
In January 2014, the editor-in-chief of Dr. Dobb's Journal, Andrew Binstock, commented on Rust's chances of becoming a competitor to C++ in addition to the languages D, Go, and Nim (then Nimrod). According to Binstock, while Rust was "widely viewed as a remarkably elegant language", adoption slowed because it repeatedly changed between versions.[47] The first stable release, Rust 1.0, was announced on May 15, 2015.[48][49]
Rust was the third-most-loved programming language in the 2015 Stack Overflow annual survey[50] and took first place for 2016–2022.[35]
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 long-term impact of the COVID-19 pandemic.[51][52] The team behind Servo, a browser engine written in Rust, was completely disbanded. The event raised concerns about the future of Rust, as some members of the team were active contributors to Rust.[53]
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.[54]
On February 8, 2021, the formation of the Rust Foundation was announced by its five founding companies (AWS, Huawei, Google, Microsoft, and Mozilla).[55][56]
On April 6, 2021, Google announced support for Rust within Android Open Source Project as an alternative to C/C++.[57]
Syntax and semantics
Hello, World program
Below is a "Hello, World!" program in Rust. The println!
macro prints the message to standard output.
fn main() {
println!("Hello, World!");
}
Keywords and control flow
In Rust, blocks of code are delimited by curly brackets, and control flow is annotated with keywords such as if
, else
, while
, and for
. Pattern matching is provided using the match
keyword.
fn main() {
let mut values = vec![1, 2, 3, 4];
for value in &values {
println!("value = {}", value);
}
if values.len() > 5 {
println!("List is longer than five items");
}
// Pattern matching
match values.len() {
0 => println!("Empty"),
1 => println!("One value"),
2..=10 => println!("Between two and ten values"),
11 => println!("Eleven values"),
_ => println!("Many values"),
};
// while loop with predicate and pattern matching using let
while let Some(value) = values.pop() {
println!("value = {}", value);
}
}
Expression blocks
Despite the syntactic resemblance to C and C++, the semantics of Rust are closer to that of the ML family of languages and the Haskell language. For example, nearly every part of a function body is an expression,[58][59] even control flow operators. The ordinary if
expression also takes the place of C's ternary conditional, an idiom used by ALGOL 60. As in Lisp, a function does not need to end with a return
expression: if the semicolon is omitted, the last expression in the function will be used as the return value, as seen in the following recursive implementation of the factorial function:
fn factorial(i: u64) -> u64 {
if i == 0 {
1
} else {
i * factorial(i - 1)
}
}
The following iterative implementation uses the ..=
operator to create an inclusive range:
fn factorial(i: u64) -> u64 {
(2..=i).product()
}
Types
Rust is strongly typed and statically typed, where all types of variables must be known during compilation, and assigning a value of a different type to a variable will result in compilation error.
Type | Description | Examples |
---|---|---|
bool
|
Boolean value |
|
u8
|
Unsigned 8-bit integer, also called a byte |
|
|
Signed integers, up to 128 bits |
|
|
Unsigned integers, up to 128 bits |
|
|
Floating-point numbers |
|
char
|
Unicode scalar value, a Unicode codepoint that is not a surrogate |
|
&str
|
Strings (static or immutable) |
|
[T; N]
|
Static arrays (size known at compile-time) |
|
[T]
|
Static arrays (size not known at compile-time) |
|
(T1, T2, ...)
|
Tuples |
|
|
References (immutable and mutable) |
|
|
|
Unlike other languages, Rust does not use null pointers to indicate a lack of data, as doing so can lead to accidental dereferencing. Therefore, in order to uphold its safety guarantees, null pointers cannot be dereferenced unless explicitly declaring the code block unsafe with an unsafe
block.[61] Rust instead uses a Haskell-like Option
type, which has two variants, Some(T)
(which indicates that a value is present) and None
(analogous to the null pointer).[62] Option
implements a "null pointer optimization" avoiding any overhead for types which cannot have a null value (references or the NonZero
types for example).[63] Option
values must be handled using syntactic sugar such as the if let
construction in order to access the inner value (in this case, a string):
fn main() {
let name: Option<String> = None;
// If name was not None, it would print here.
if let Some(name) = name {
println!("{}", name);
}
}
Type | Description | Examples |
---|---|---|
String
|
Strings (dynamic) |
|
Vec<T>
|
Dynamic arrays |
|
Option<T>
|
Option type |
|
|
| |
Result<T, E>
|
Error handling |
|
Generics
More advanced features in Rust include the use of generic functions to achieve type polymorphism. The following is a Rust program to calculate 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
}
Generics in Rust use trait bounds for their generic parameters, which precisely define what is required of a type in order to be used with a given generic function. This allows generics in Rust to be type-checked without having to substitute concrete types. Unlike C++ templates, substitution failure cannot occur.
Ownership and lifetimes
Rust uses an ownership system, where each value has a unique owner. Values are moved between different owners through assignment or passing a value as a function parameter. Functions taking ownership of a parameter are said to consume the value in question. Ownership in Rust is similar to move semantics in C++, however, unlike C++, the compiler keeps track of moved values and all types are movable by default. This means that types in Rust do not have to implement an "empty" or "invalid" state (and corresponding runtime checks) to signify that a value has been moved out of, because using a moved value is a compile-time error in Rust:
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
}
In Rust, when a value goes "out of scope", it is dropped by running its destructor.
Lifetimes are a usually implicit part of all reference types in Rust. Each particular lifetime encompasses a set of locations in the code; a lifetime is said to outlive another if it is valid in at least all locations of the latter. The borrow checker in the Rust compiler checks that for all references used, the values referred to outlive the reference. It also ensures that a mutable reference only exists if no immutable references exist at the same time ("alias-xor-mutable").
Rust defines the relationship between the lifetimes of the objects used and created by functions as part of their signature using lifetime parameters. In languages like C or C++ the information about which objects have to outlive others is informally specified in documentation or comments, if at all, and cannot be checked by the compiler.
The example below parses some configuration options from a string and creates a struct containing the options. The struct only contains references to the data, so for the struct to remain valid, the data referred to by the struct needs to be valid as well. The function signature for "parse_config" specifies this relationship explicitly. In this example, the explicit lifetimes are unnecessary in newer Rust versions due to lifetime elision, which is an algorithm that automatically assigns lifetimes to functions if they are trivial.
use std::collections::HashMap;
#[derive(Debug)]
// This struct has one lifetime parameter, 'src. The name is only used within the struct's definition.
struct Config<'src> {
hostname: &'src str,
username: &'src str,
}
// This function also has a lifetime parameter, 'cfg. 'cfg is attached to the "config" parameter, which
// establishes that the data in "config" lives at least as long as the 'cfg lifetime.
// The returned struct also uses 'cfg for it's lifetime, so it can live at most as long as 'cfg.
fn parse_config<'cfg>(config: &'cfg str) -> Config<'cfg> {
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);
}
Features
Rust aims to support concurrent systems programming, which has inspired a feature set with an emphasis on safety, control of memory layout, and concurrency.[64]
Memory safety
Rust is designed to be memory safe. It does not permit null pointers, dangling pointers, or data races.[65][66][67] Data values can be initialized only through a fixed set of forms, all of which require their inputs to be already initialized.[68] To replicate pointers being either valid or NULL
, such as in linked list or binary tree data structures, the Rust core library provides an option type, which can be used to test whether a pointer has Some
value or None
.[66] Rust has added syntax to manage lifetimes, which are checked at compile time by the borrow checker. Unsafe code can subvert some of these restrictions using the unsafe
keyword.[69]
Memory management
Rust does not use automated garbage collection. Memory and other resources are managed through the resource acquisition is initialization convention,[70] with optional reference counting. Rust provides deterministic management of resources, with very low overhead.[71] Values are allocated on the stack by default and all dynamic allocations must be explicit.[72]
There is the concept of references (using the &
symbol), which does not involve run-time reference counting. The safety of such pointers is verified at compile time, preventing dangling pointers and other forms of undefined behavior. 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.
Ownership
Rust has an ownership system where all values have a unique owner, and the scope of the value is the same as the scope of the owner.[73][74] Values can be passed by immutable reference, using &T
, by mutable reference, using &mut T
, or by value, using T
. At all times, there can either be multiple immutable references or one mutable reference (obviating the need for a readers–writer lock). The Rust compiler enforces these rules at compile time and also checks that all references are valid.
Types and polymorphism
Rust's type system supports a mechanism called traits, inspired by type classes in the Haskell language. Traits annotate types and are used to define shared behavior between different types. For example, floats and integers both implement the Add
trait because they can both be added; and any type that can be printed out as a string implements the Display
or Debug
traits. This facility is known as ad hoc polymorphism.
Rust uses type inference for variables declared with the keyword let
. Such variables do not require a value to be initially assigned to determine their type. A compile time error results if any branch of code leaves the variable without an assignment.[75] Variables assigned multiple times must be marked with the keyword mut
(short for mutable).
A function can be given generic parameters, which allows the same function to be applied to different types. 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 function can be type-checked as soon as it is defined.
The implementation of Rust 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. Rust's type erasure is also available by using the keyword dyn
(short for dynamic) .The benefit of monomorphization is optimized code for each specific use case; the drawback is increased compile time and size of the resulting binaries.
In Rust, user-defined types are created with the struct
or enum
keywords. The struct
type shares similarities C++ structs. The enum
type shares similarities with the Haskell data
keyword. These types usually contain fields of data like objects or classes in other languages. The impl
keyword can define methods for the types (data and functions are defined separately) or implement a trait for the types. A trait is a contract that a structure has certain required methods implemented. Traits are used to restrict generic parameters and because traits can provide a struct with more methods than the user defined. For example, the trait Iterator
requires that the next
method be defined for the type. Once the next
method is defined the trait provides common functional helper methods over the iterator like map
or filter
.
Type aliases, including generic arguments, can also be defined with the type
keyword.
The object system within Rust is based around implementations, traits and structured types. Implementations fulfill a role similar to that of classes within other languages and are defined with the keyword impl
. Traits provide inheritance and polymorphism; they allow methods to be defined and mixed in to implementations. Structured types are used to define fields. Implementations and traits cannot define fields themselves, and only traits can provide inheritance. Among other benefits, this prevents the diamond problem of multiple inheritance, as in C++. In other words, Rust supports interface inheritance but replaces implementation inheritance with composition; see composition over inheritance.
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 (also known as duck typing).[76] Dynamically dispatched trait objects are declared using the syntax Box<dyn Tr>
where Tr
is a trait. For example, it is possible to create a list of objects which each can be printed out as follows: let v: Vec<Box<dyn Display>> = vec![Box::new(3), Box::new(5.0), Box::new("hi")]
.[76] Trait objects are dynamically sized; however, prior to 2015, the dyn
keyword was optional.[77] A trait object is essentially a fat pointer that include a pointer as well as additional information about what type the pointer is.[78][note 5]
Macros for language extension
It is possible to extend the Rust language using the procedural macro mechanism.[79]
Procedural macros use Rust functions that are compiled before other components to run and modify the compiler's input token stream. This complements the declarative macro mechanism (also known as macros by example), which uses pattern matching to achieve similar goals.
Procedural macros come in three flavors:
- Function-like macros
custom!(...)
- Derive macros
#[derive(CustomDerive)]
- Attribute macros
#[custom_attribute]
The println!
macro is an example of a function-like macro and serde_derive
[80] is a commonly used library for generating code
for reading and writing data in many formats such as JSON. Attribute macros are commonly used for language bindings such as the extendr
library for Rust bindings to R.[81]
The following code shows the use of the Serialize
, Deserialize
and Debug
derive procedural macros
to implement JSON reading and writing as well as the ability to format a structure for debugging.
use serde_json::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug)]
struct Point {
x: i32,
y: i32,
}
fn main() {
let point = Point { x: 1, y: 2 };
let serialized = serde_json::to_string(&point).unwrap();
println!("serialized = {}", serialized);
let deserialized: Point = serde_json::from_str(&serialized).unwrap();
println!("deserialized = {:?}", deserialized);
}
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. Rust also has a library, CXX, for calling to or from C++.[82]
Components
Besides the compiler and standard library, the Rust ecosystem includes additional components for software development. Component installation is typically managed by rustup, a Rust toolchain installer developed by the Rust project.[83]
Cargo
Cargo is Rust's build system and package manager. Cargo downloads, compiles, distributes, and uploads packages, called crates,[84] maintained in the official registry.[85] Cargo also acts as a front-end for Clippy and other Rust components.
Cargo requires projects to follow a certain directory structure, with some flexibility.[86] Projects using Cargo may be either a single crate or a workspace composed of multiple crates that may depend on each other.[87]
The dependencies for a crate are specified in a Cargo.toml file along with version requirements in the format of Semantic Versioning (SemVer), telling Cargo which versions of the dependency are compatible with the crate using them.[88] By default, Cargo sources its dependencies from the user-contributed registry crates.io, but Git repositories and crates in the local filesystem and other external sources can be specified as dependencies, too.[89]
Rustfmt
Rustfmt is a code formatter for Rust. It takes Rust source code as input and changes the whitespace and indentation to produce code formatted in accordance to the Rust style guide or rules specified in a rustfmt.toml file. Rustfmt can be invoked as a standalone program or on a Rust project through Cargo.[90][91]
Clippy
Clippy is Rust's built-in linting tool to improve the correctness, performance, and readability of Rust code. It was created in 2014[92] and named after the eponymous Microsoft Office feature.[93] As of 2021, Clippy has more than 450 rules,[94] which can be browsed online and filtered by category.[95] Some rules are disabled by default.
Versioning system
Following Rust 1.0, new features are developed in nightly versions which release on a daily basis. During each release cycle of six weeks, changes on nightly versions are released to beta, while changes from the previous beta version are released to a new stable version.[96][97]
Every three years, a new "edition" is produced. Editions are released to provide an easy reference point for changes due to the frequent nature of Rust's train release schedule, and to provide a window to make limited breaking changes. Editions are largely compatible and migration to a new edition is trivialized with automated tooling.[98]
IDE support
The most popular language server for Rust is rust-analyzer.[99] The original language server, RLS[100] was officially deprecated in favor of rust-analyzer in July 2022.[101] These projects provide IDEs and text editors with more information about a Rust project. Basic features include linting checks via Clippy and formatting via Rustfmt, among other functions.
Performance
Rust aims "to be as efficient and portable as idiomatic C++, without sacrificing safety".[102] Since Rust utilizes LLVM, any performance improvements in LLVM also carry over to Rust.[103]
Unlike C and C++, Rust allows re-organizing struct and enum element ordering. This can be done to reduce the size of structures in memory, for better memory alignment, and to improve cache access efficiency.[104][105]
Rust does not perform garbage collection, which allows it to be more efficient and performant than other memory safe languages.[106]
Adoption
Rust has been adopted for components at a number of major software companies, including Amazon,[23] Cloudflare,[107][108] Discord,[24] Dropbox, Facebook,[109] Microsoft, and the Mozilla Foundation.
Web browsers and services
- Firefox has two projects written in Rust: the Servo parallel browser engine[110] developed by Mozilla in collaboration with Samsung;[111] and Quantum, which is composed of several sub-projects for improving Mozilla's Gecko browser engine.[112]
- OpenDNS uses Rust in two of its components.[113][114][115]
- Deno, a secure runtime for JavaScript and TypeScript, is built with V8, Rust, and Tokio.[116]
- Figma, a web-based vector graphics editor, is written in Rust.
Operating systems
- Redox is a "full-blown Unix-like operating system" including a microkernel written in Rust.[117]
- Theseus, an experimental OS with "intralingual design", is written in Rust.[118]
- The Google Fuchsia capability-based operating system has components written in Rust,[119] including a TCP/IP library. [120]
- Stratis is a file system manager written in Rust for Fedora[121] and RHEL 8.[122]
- exa is a Unix/Linux command line alternative to ls written in Rust.
- Since 2021, there is a patch series for adding Rust support to the Linux kernel.[123]
Other notable projects and platforms
- Discord uses Rust for portions of its backend, as well as client-side video encoding,[24] to augment the core infrastructure written in Elixir.[124]
- Microsoft Azure IoT Edge, a platform used to run Azure services and artificial intelligence on IoT devices, has components implemented in Rust.[125]
- Polkadot is an open source blockchain platform and cryptocurrency written in Rust.
- Ruffle is an open-source SWF emulator written in Rust.[126]
- TerminusDB, an open source graph database designed for collaboratively building and curating knowledge graphs, is written in Prolog and Rust.[127]
- Amazon Web Services has multiple projects written in Rust, including Firecracker, a virtualization solution,[128] and Bottlerocket, a Linux distribution and containerization solution.[129]
Community
Conferences
Rust's official website lists online forums, messaging platforms, and in-person meetups for the Rust community.[131] Conferences dedicated to Rust development include:
- RustConf: an annual conference in Portland, Oregon. Held annually since 2016 (except in 2020 and 2021 because of the COVID-19 pandemic).[132]
- Rust Belt Rust: a #rustlang conference in the Rust Belt[133]
- RustFest: Europe's @rustlang conference[134]
- RustCon Asia[135]
- Rust LATAM[136]
- Oxidize Global[137]
Rust Foundation
Formation | February 8, 2021 |
---|---|
Founders | |
Type | Nonprofit organization |
Location | |
Shane Miller | |
Rebecca Rumbul | |
Website | foundation |
The Rust Foundation is a non-profit membership organization incorporated in Delaware, United States, with the primary purposes of supporting the maintenance and development of the language, cultivating the Rust project team members and user communities, managing the technical infrastructure underlying the development of Rust, and managing and stewarding the Rust trademark.
It was established on February 8, 2021, with five founding corporate members (Amazon Web Services, Huawei, Google, Microsoft, and Mozilla).[138] The foundation's board is chaired by Shane Miller.[139] Starting in late 2021, its Executive Director and CEO is Rebecca Rumbul.[140] Prior to this, Ashley Williams was interim executive director.[141]
Governance teams
The Rust project is composed of teams that are responsible for different subareas of the development. For example, the Core team is responsible for "Managing the overall direction of Rust, subteam leadership, and any cross-cutting issues," the Compiler team is responsible for "Developing and managing compiler internals and optimizations," and the Language team is responsible for "Designing and helping to implement new language features," according to the official website.[142]
See also
- Comparison of programming languages
- History of programming languages
- List of programming languages
- List of programming languages by type
Notes
- ^ Including x86-64, ARM, MIPS, RISC-V, WebAssembly, i686, AArch64, armv7, mips64, mipsel, mips64el, powerpc, powerpc64, powerpc64le, and s390x. The degree of standard library support varies.
- ^ 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.
- ^ For a complete list, see[6]
- ^ That is, among respondents who have done "extensive development work [with Rust] in over the past year" (9.3%), Rust had the largest percentage who also expressed interest to "work in [Rust] over the next year" (87%).
- ^ Section 2: Rust Trait Overview
References
- ^ "Announcing Rust 1.62.0 (English)".
- ^ a b "Platform Support - The rustc book". doc.rust-lang.org. Retrieved 2022-06-27.
- ^ "Rust Legal Policies". Rust-lang.org. Archived from the original on 2018-04-04. Retrieved 2018-04-03.
- ^ "Note Research: Type System". GitHub. 2015-02-01. Archived from the original on 2019-02-17. Retrieved 2015-03-25.
- ^ "RFC for 'if let' expression". GitHub. Archived from the original on 2016-03-04. Retrieved 2014-12-04.
- ^ a b "The Rust Reference: Appendix: Influences". Archived from the original on 2019-01-26. Retrieved 2018-11-11.
- ^ "Command Optimizations?". 2014-06-26. Archived from the original on 2019-07-10. Retrieved 2014-12-10.
- ^ "Idris – Uniqueness Types". Archived from the original on 2018-11-21. Retrieved 2018-11-20.
- ^ Jaloyan, Georges-Axel (2017-10-19). "Safe Pointers in SPARK 2014". arXiv:1710.07047. Bibcode:2017arXiv171007047J. Archived from the original on 2022-02-02. Retrieved 2022-02-02.
- ^ Lattner, Chris. "Chris Lattner's Homepage". Nondot.org. Archived from the original on 2018-12-25. Retrieved 2019-05-14.
- ^ "Microsoft opens up Rust-inspired Project Verona programming language on GitHub". ZDNet. Archived from the original on 2020-01-17. Retrieved 2020-01-17.
- ^ "PHP RFC: Shorter Attribute Syntax". 2020-06-03. Archived from the original on 2021-03-07. Retrieved 2021-03-17.
- ^ Quentin, Ochem. "Rust and SPARK: Software Reliability for Everyone". Electronic Design. Retrieved 2022-06-22.
- ^ a b Perkel, Jeffrey M. (2020-12-01). "Why scientists are turning to Rust". Nature. 588 (7836): 185–186. doi:10.1038/d41586-020-03382-2. Archived from the original on 2022-05-06. Retrieved 2022-05-15.
- ^ a b c d Balasubramanian, Abhiram; Baranowski, Marek S.; Burtsev, Anton; Panda, Aurojit; Rakamarić, Zvonimir; Ryzhyk, Leonid (2017-05-07). "System Programming in Rust: Beyond Safety". Proceedings of the 16th Workshop on Hot Topics in Operating Systems. HotOS '17. New York, NY, USA: Association for Computing Machinery: 156–161. doi:10.1145/3102980.3103006. ISBN 978-1-4503-5068-6. Archived from the original on 2022-06-11. Retrieved 2022-06-01.
- ^ Yegulalp, Serdar (2021-10-06). "What is the Rust language? Safe, fast, and easy software development". InfoWorld. Retrieved 2022-06-25.
- ^ Shamrell-Harrington, Nell. "The Rust Borrow Checker - a Deep Dive". InfoQ. Retrieved 2022-06-25.
- ^ Blanco-Cuaresma, Sergi; Bolmont, Emeline (2017-05-30). "What can the programming language Rust do for astrophysics?". Proceedings of the International Astronomical Union. 12 (S325): 341–344. doi:10.1017/S1743921316013168. ISSN 1743-9213.
- ^ "Rust language". Archived from the original on 2020-09-06. Retrieved 2020-09-09.
Mozilla was the first investor for Rust and continues to sponsor the work of the open source project. Mozilla also utilizes Rust in many of its core initiatives including Servo and key parts of Firefox.
- ^ Asay, Matt (2021-04-12). "Rust, not Firefox, is Mozilla's greatest industry contribution". TechRepublic. Retrieved 2022-07-07.
- ^ Bright, Peter (2013-04-03). "Samsung teams up with Mozilla to build browser engine for multicore machines". Ars Technica. Archived from the original on 2016-12-16. Retrieved 2013-04-04.
- ^ "Why AWS loves Rust, and how we'd like to help". Amazon Web Services. 2020-11-24. Archived from the original on 2020-12-03. Retrieved 2022-04-21.
- ^ a b "How our AWS Rust team will contribute to Rust's future successes". Amazon Web Services. 2021-03-03. Archived from the original on 2022-01-02. Retrieved 2022-01-02.
- ^ a b c Howarth, Jesse (2020-02-04). "Why Discord is switching from Go to Rust". Archived from the original on 2020-06-30. Retrieved 2020-04-14.
- ^ The Dropbox Capture Team. "Why we built a custom Rust library for Capture". Dropbox.Tech. Archived from the original on 2022-04-06. Retrieved 2022-04-21.
- ^ "A brief history of Rust at Facebook". Engineering at Meta. 2021-04-29. Archived from the original on 2022-01-19. Retrieved 2022-04-21.
- ^ Amadeo, Ron (2021-04-07). "Google is now writing low-level Android code in Rust". Ars Technica. Archived from the original on 2021-04-08. Retrieved 2022-04-21.
- ^ "Rust in the Android platform". Google Online Security Blog. Archived from the original on 2022-04-03. Retrieved 2022-04-21.
- ^ "Why Rust for safe systems programming". Microsoft Security Response Center. Archived from the original on 2019-07-22. Retrieved 2022-04-21.
- ^ Tung, Liam. "Microsoft: Why we used programming language Rust over Go for WebAssembly on Kubernetes app". ZDNet. Archived from the original on 2022-04-21. Retrieved 2022-04-21.
- ^ "Rust | TIOBE - The Software Quality Company". www.tiobe.com. Archived from the original on 2022-03-03. Retrieved 2022-05-15.
- ^ "Computer Scientist proves safety claims of the programming language Rust". EurekAlert!. Archived from the original on 2022-02-24. Retrieved 2022-05-15.
- ^ Jung, Ralf; Jourdan, Jacques-Henri; Krebbers, Robbert; Dreyer, Derek (2017-12-27). "RustBelt: securing the foundations of the Rust programming language". Proceedings of the ACM on Programming Languages. 2 (POPL): 66:1–66:34. doi:10.1145/3158154. Archived from the original on 2022-06-11. Retrieved 2022-05-15.
- ^ Jung, Ralf (2020). Understanding and evolving the Rust programming language (Thesis). doi:10.22028/D291-31946. Archived from the original on 2022-03-08. Retrieved 2022-05-15.
- ^ a b c "Stack Overflow Developer Survey 2022". Stack Overflow. Retrieved 2022-06-22.
- ^ a b "FAQ – The Rust Project". Rust-lang.org. Archived from the original on 2016-06-09. Retrieved 2019-06-27.
- ^ Hoare, Graydon (2010-10-02). "Rust Progress". Archived from the original on 2014-08-15. Retrieved 2010-10-30.
- ^ "Future Tense". 2011-04-29. Archived from the original on 2012-07-01. Retrieved 2012-02-06.
- ^ Hoare, Graydon (2010-07-07). Project Servo (PDF). Mozilla Annual Summit 2010. Whistler, Canada. Archived (PDF) from the original on 2017-07-11. Retrieved 2017-02-22.
- ^ Hoare, Graydon (2011-04-20). "[rust-dev] stage1/rustc builds". Archived from the original on 2011-07-20. Retrieved 2011-04-20.
- ^ Hoare, Graydon (2014-06-07). "Internet archaeology: the definitive, end-all source for why Rust is named "Rust"". Reddit.com. Archived from the original on 2016-07-14. Retrieved 2016-11-03.
- ^ Brian, Anderson (2012-01-20). "[rust-dev] The Rust compiler 0.1 is unleashed". Archived from the original on 2014-09-05. Retrieved 2022-05-18.
- ^ Hoare, Graydon (2012-03-29). "[rust-dev] Rust 0.2 released". mail.mozilla.org. Retrieved 2022-06-12.
- ^ Hoare, Graydon (2012-07-12). "[rust-dev] Rust 0.3 released". mail.mozilla.org. Retrieved 2022-06-12.
- ^ Hoare, Graydon. "[rust-dev] Rust 0.4 released". mail.mozilla.org. Archived from the original on 2021-10-31. Retrieved 2021-10-31.
- ^ Duarte, José; Ravara, António (2021-09-27), "Retrofitting Typestates into Rust", 25th Brazilian Symposium on Programming Languages, New York, NY, USA: Association for Computing Machinery, pp. 83–91, doi:10.1145/3475061.3475082, ISBN 978-1-4503-9062-0, retrieved 2022-07-12
- ^ Binstock, Andrew. "The Rise And Fall of Languages in 2013". Dr Dobb's. Archived from the original on 2016-08-07. Retrieved 2015-12-11.
- ^ "Version History". GitHub. Archived from the original on 2015-05-15. Retrieved 2017-01-01.
- ^ The Rust Core Team (2015-05-15). "Announcing Rust 1.0". Archived from the original on 2015-05-15. Retrieved 2015-12-11.
- ^ "Stack Overflow Developer Survey 2015". Stackoverflow.com. Archived from the original on 2016-12-31. Retrieved 2016-11-03.
- ^ Cimpanu, Catalin (2020-08-11). "Mozilla lays off 250 employees while it refocuses on commercial products". ZDNet. Archived from the original on 2022-03-18. Retrieved 2020-12-02.
- ^ Cooper, Daniel (2020-08-11). "Mozilla lays off 250 employees due to the pandemic". Engadget. Archived from the original on 2020-12-13. Retrieved 2020-12-02.
- ^ Tung, Liam. "Programming language Rust: Mozilla job cuts have hit us badly but here's how we'll survive". ZDNet. Archived from the original on 2022-04-21. Retrieved 2022-04-21.
- ^ "Laying the foundation for Rust's future". Rust Blog. 2020-08-18. Archived from the original on 2020-12-02. Retrieved 2020-12-02.
- ^ "Hello World!". Rust Foundation. 2020-02-08. Archived from the original on 2022-04-19. Retrieved 2022-06-04.
- ^ "Mozilla Welcomes the Rust Foundation". Mozilla Blog. 2021-02-09. Archived from the original on 2021-02-08. Retrieved 2021-02-09.
- ^ Amadeo, Ron (2021-04-07). "Google is now writing low-level Android code in Rust". Ars Technica. Archived from the original on 2021-04-08. Retrieved 2021-04-08.
- ^ "rust/src/grammar/parser-lalr.y". GitHub. 2017-05-23. Archived from the original on 2021-10-22. Retrieved 2017-05-23.
- ^ "Statements and expressions". The Rust Reference. Retrieved 2022-06-13.
- ^ "Textual types". The Rust Reference. Retrieved 2022-06-12.
- ^ "Unsafety - The Rust Reference". The Rust Reference. Archived from the original on 2022-04-23. Retrieved 2022-04-08.
- ^ "Option in std::option - Rust". The Rust Standard Library. Archived from the original on 2022-04-07. Retrieved 2022-04-08.
- ^ "Module std::option". Rust standard library documentation. Retrieved 2022-06-21.
- ^ Avram, Abel (2012-08-03). "Interview on Rust, a Systems Programming Language Developed by Mozilla". InfoQ. Archived from the original on 2013-07-24. Retrieved 2013-08-17.
- ^ Rosenblatt, Seth (2013-04-03). "Samsung joins Mozilla's quest for Rust". Archived from the original on 2013-04-04. Retrieved 2013-04-05.
- ^ a b Brown, Neil (2013-04-17). "A taste of Rust". Archived from the original on 2013-04-26. Retrieved 2013-04-25.
- ^ "Races - The Rustonomicon". doc.rust-lang.org. Archived from the original on 2017-07-10. Retrieved 2017-07-03.
- ^ "The Rust Language FAQ". static.rust-lang.org. 2015. Archived from the original on 2015-04-20. Retrieved 2017-04-24.
- ^ "Unsafe Rust". Archived from the original on 2020-10-14. Retrieved 2020-10-17.
- ^ "RAII – Rust By Example". doc.rust-lang.org. Archived from the original on 2019-04-21. Retrieved 2020-11-22.
- ^ "Abstraction without overhead: traits in Rust". Rust Blog. Archived from the original on 2021-09-23. Retrieved 2021-10-19.
- ^ "Box, stack and heap". Rust By Example. Retrieved 2022-06-13.
- ^ Klabnik, Steve; Nichols, Carol (June 2018). "Chapter 4: Understanding Ownership". The Rust Programming Language. San Francisco, California: No Starch Press. p. 44. ISBN 978-1-593-27828-1. Archived from the original on 2019-05-03. Retrieved 2019-05-14.
- ^ "The Rust Programming Language: What is Ownership". Rust-lang.org. Archived from the original on 2019-05-19. Retrieved 2019-05-14.
- ^ Walton, Patrick (2010-10-01). "Rust Features I: Type Inference". Archived from the original on 2011-07-08. Retrieved 2011-01-21.
- ^ a b "Using Trait Objects That Allow for Values of Different Types - The Rust Programming Language". doc.rust-lang.org. Retrieved 2022-07-11.
- ^ "Trait object types - The Rust Reference". doc.rust-lang.org. Retrieved 2022-07-11.
- ^ VanHattum, Alexa; Schwartz-Narbonne, Daniel; Chong, Nathan; Sampson, Adrian (2022). "Verifying Dynamic Trait Objects in Rust". 2022 IEEE/ACM 44th International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP): 321–330. doi:10.1109/ICSE-SEIP55303.2022.9794041.
- ^ "Procedural Macros". The Rust Programming Language Reference. Archived from the original on 2020-11-07. Retrieved 2021-03-23.
- ^ "Serde Derive". Serde Derive documentation. Archived from the original on 2021-04-17. Retrieved 2021-03-23.
- ^ "extendr_api - Rust". Extendr Api Documentation. Archived from the original on 2021-05-25. Retrieved 2021-03-23.
- ^ "Safe Interoperability between Rust and C++ with CXX". InfoQ. 2020-12-06. Archived from the original on 2021-01-22. Retrieved 2021-01-03.
- ^ rust-lang/rustup, The Rust Programming Language, 2021-05-17, archived from the original on 2021-05-09, retrieved 2021-05-17
- ^ "Packages and Crates - The Rust Programming Language". doc.rust-lang.org. Archived from the original on 2022-02-04. Retrieved 2022-02-04.
- ^ "The Cargo Book". Archived from the original on 2021-05-15. Retrieved 2022-02-19.
- ^ "Why Cargo Exists". The Cargo Book. Archived from the original on 2022-04-07. Retrieved 2021-05-18.
- ^ "Workspaces - The Cargo Book". doc.rust-lang.org. Archived from the original on 2022-02-28. Retrieved 2022-02-28.
- ^ "Dependency Resolution - The Cargo Book". doc.rust-lang.org. Archived from the original on 2022-02-28. Retrieved 2022-02-28.
- ^ "Specifying Dependencies - The Cargo Book". doc.rust-lang.org. Archived from the original on 2022-04-07. Retrieved 2021-05-17.
- ^ "rust-dev-tools/fmt-rfcs". GitHub. Archived from the original on 2021-10-14. Retrieved 2021-09-21.
- ^ "rustfmt". GitHub. Archived from the original on 2021-05-16. Retrieved 2021-05-19.
- ^ "Create README.md · rust-lang/rust-clippy@507dc2b". GitHub. Archived from the original on 2021-11-22. Retrieved 2021-11-22.
- ^ "Day 1 - cargo subcommands | 24 days of Rust". zsiciarz.github.io. Archived from the original on 2022-04-07. Retrieved 2021-11-22.
- ^ "rust-lang/rust-clippy". GitHub. Archived from the original on 2021-05-23. Retrieved 2021-05-21.
- ^ "ALL the Clippy Lints". Archived from the original on 2021-05-22. Retrieved 2021-05-22.
- ^ "Scheduling the Trains". Archived from the original on 2017-01-02. Retrieved 2017-01-01.
- ^ "G - How Rust is Made and "Nightly Rust" - The Rust Programming Language". doc.rust-lang.org. Archived from the original on 2021-05-10. Retrieved 2021-05-22.
- ^ "What are editions? - The Edition Guide". doc.rust-lang.org. Archived from the original on 2021-05-14. Retrieved 2021-05-22.
- ^ rust-analyzer/rust-analyzer, rust-analyzer, 2022-01-02, archived from the original on 2022-01-03, retrieved 2022-01-02
- ^ "rust-lang/rls". GitHub. Archived from the original on 2021-05-15. Retrieved 2021-05-26.
- ^ "RLS Deprecation | Rust Blog". blog.rust-lang.org. Retrieved 2022-07-09.
- ^ Walton, Patrick (2010-12-05). "C++ Design Goals in the Context of Rust". Archived from the original on 2010-12-09. Retrieved 2011-01-21.
- ^ "How Fast Is Rust?". The Rust Programming Language FAQ. Archived from the original on 2020-10-28. Retrieved 2019-04-11.
- ^ "Type layout". The Rust Reference.
- ^ "PacketMill: toward per-Core 100-Gbps networking". ACM Conferences. doi:10.1145/3445814.3446724. 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] ...
- ^ Anderson, Tim. "Can Rust save the planet? Why, and why not". The Register. Retrieved 2022-07-11.
- ^ "How we made Firewall Rules". The Cloudflare Blog. 2019-03-04. Retrieved 2022-06-11.
- ^ "Enjoy a slice of QUIC, and Rust!". The Cloudflare Blog. 2019-01-22. Retrieved 2022-06-11.
- ^ "A brief history of Rust at Facebook". Engineering at Meta. 2021-04-29. Archived from the original on 2022-01-19. Retrieved 2022-01-19.
- ^ Yegulalp, Serdar (2015-04-03). "Mozilla's Rust-based Servo browser engine inches forward". InfoWorld. Archived from the original on 2016-03-16. Retrieved 2016-03-15.
- ^ Lardinois, Frederic (2015-04-03). "Mozilla And Samsung Team Up To Develop Servo, Mozilla's Next-Gen Browser Engine For Multicore Processors". TechCrunch. Archived from the original on 2016-09-10. Retrieved 2017-06-25.
- ^ Bryant, David (2016-10-27). "A Quantum Leap for the web". Medium. Archived from the original on 2020-12-09. Retrieved 2016-10-27.
- ^ Balbaert, Ivo (2015-05-27). Rust Essentials. Packt Publishing. p. 6. ISBN 978-1785285769. Archived from the original on 2021-05-25. Retrieved 2016-03-21.
- ^ Frank, Denis (2013-12-05). "Using HyperLogLog to Detect Malware Faster Than Ever". OpenDNS Security Labs. Archived from the original on 2017-08-14. Retrieved 2016-03-19.
- ^ Denis, Frank (2013-10-04). "ZeroMQ: Helping us Block Malicious Domains in Real Time". OpenDNS Security Labs. Archived from the original on 2017-08-14. Retrieved 2016-03-19.
- ^ Garbutt, James (2019-01-27). "First thoughts on Deno, the JavaScript/TypeScript run-time". 43081j.com. Archived from the original on 2020-11-07. Retrieved 2019-09-27.
- ^ Yegulalp, Serdar. "Rust's Redox OS could show Linux a few new tricks". infoworld. Archived from the original on 2016-03-21. Retrieved 2016-03-21.
- ^ "Introduction to Theseus". Theseus OS Book. Archived from the original on 2021-07-11. Retrieved 2021-07-11.
- ^ "Google Fushcia's source code". Google Git. Archived from the original on 2021-07-09. Retrieved 2021-07-02.
- ^ "src/connectivity/network/netstack3/core/src - fuchsia". Google Git. Archived from the original on 2022-06-11. Retrieved 2022-04-21.
- ^ Sei, Mark (2018-10-10). "Fedora 29 new features: Startis now officially in Fedora". Marksei, Weekly sysadmin pills. Archived from the original on 2019-04-13. Retrieved 2019-05-13.
- ^ "RHEL 8: Chapter 8. Managing layered local storage with Stratis". 2018-10-10. Archived from the original on 2019-04-13. Retrieved 2019-04-13.
- ^ "rust-for-linux.vger.kernel.org archive mirror". lore.kernel.org. Archived from the original on 2022-03-08. Retrieved 2022-03-24.
- ^ Vishnevskiy, Stanislav (2017-07-06). "How Discord Scaled Elixir to 5,000,000 Concurrent Users". Discord Blog. Archived from the original on 2020-04-26. Retrieved 2021-08-14.
- ^ Nichols, Shaun (2018-06-27). "Microsoft's next trick? Kicking things out of the cloud to Azure IoT Edge". The Register. Archived from the original on 2019-09-27. Retrieved 2019-09-27.
- ^ "Ruffle". Ruffle. Archived from the original on 2021-01-26. Retrieved 2021-04-14.
- ^ terminusdb/terminusdb-store, TerminusDB, 2020-12-14, archived from the original on 2020-12-15, retrieved 2020-12-14
- ^ "Firecracker – Lightweight Virtualization for Serverless Computing". Amazon Web Services. 2018-11-26. Archived from the original on 2021-12-08. Retrieved 2022-01-02.
- ^ "Announcing the General Availability of Bottlerocket, an open source Linux distribution built to run containers". Amazon Web Services. 2020-08-31. Archived from the original on 2022-01-02. Retrieved 2022-01-02.
- ^ "Getting Started". rust-lang.org. Archived from the original on 2020-11-01. Retrieved 2020-10-11.
- ^ "Community". www.rust-lang.org. Archived from the original on 2022-01-03. Retrieved 2022-01-03.
- ^ "RustConf 2020 - Thursday, August 20". rustconf.com. Archived from the original on 2019-08-25. Retrieved 2019-08-25.
- ^ Rust Belt Rust. Dayton, Ohio. 2019-10-18. Archived from the original on 2019-05-14. Retrieved 2019-05-14.
- ^ RustFest. Barcelona, Spain: asquera Event UG. 2019. Archived from the original on 2019-04-24. Retrieved 2019-05-14.
- ^ "RustCon Asia 2019 – About". RustCon Asia. Archived from the original on 2021-05-09. Retrieved 2022-04-21.
- ^ "Rust Latam". Rust Latam. Archived from the original on 2021-04-16. Retrieved 2022-04-21.
- ^ "Oxidize Global". Oxidize Berlin Conference. Archived from the original on 2021-02-06. Retrieved 2021-02-01.
- ^ Krill, Paul. "Rust language moves to independent foundation". InfoWorld. Archived from the original on 2021-04-10. Retrieved 2021-04-10.
- ^ Vaughan-Nichols, Steven J. (2021-04-09). "AWS's Shane Miller to head the newly created Rust Foundation". ZDNet. Archived from the original on 2021-04-10. Retrieved 2021-04-10.
- ^ Vaughan-Nichols, Steven J. (2021-11-17). "Rust Foundation appoints Rebecca Rumbul as executive director". ZDNet. Archived from the original on 2021-11-18. Retrieved 2021-11-18.
- ^ "The Rust programming language now has its own independent foundation". TechRepublic. 2021-02-10. Archived from the original on 2021-11-18. Retrieved 2021-11-18.
- ^ "Governance". The Rust Programming Language. Archived from the original on 2022-05-10. Retrieved 2022-05-07.
Further reading
- Klabnik, Steve; Nichols, Carol (2019-08-12). The Rust Programming Language (Covers Rust 2018). No Starch Press. ISBN 978-1-7185-0044-0. (online version)
- Blandy, Jim; Orendorff, Jason; Tindall, Leonora F. S. (2021-07-06). Programming Rust: Fast, Safe Systems Development. O'Reilly Media. ISBN 978-1492052593.
External links