Glossary

From Rust Community Wiki
Revision as of 20:07, 31 July 2020 by Aloso (talk | contribs) (→‎Compiler internals: Add borrowck)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is a list of words which both new and less new Rustaceans might not know the meaning of. Not all words here are Rust-specific.

Words which take only a couple of sentences to explain belong here.

See also Rust Tropes.

Community[edit]

URLO[edit]

Short for users.rust-lang.org. This is the official forum for users of Rust.

IRLO[edit]

Short for internals.rust-lang.org. This is the official forum for discussing the design and implementation of Rust.

Rustacean[edit]

Rustacean is a term that is used to refer to rust programmers. It is a play on the word "crustacean".

RIIR[edit]

An acronym for "Rewrite It In Rust". Rustaceans notoriously try to rewrite everything in Rust.

RESF[edit]

Short for "Rust Evangelism Strike Force", used to mockingly refer to members of the Rust community who constantly promote Rust and demonize all other languages.

WG[edit]

Short for "Working Group" - a group of people who work to improve Rust in some way. See the official list of WGs.

RFC[edit]

An acronym for "Request For Comments". Completely separate from the IETF's RFCs, but with a similar concept.

RFCs can be looked up in the RFC book. Active RFCs are listed on rfcbot.rs.

MSRV[edit]

Acronym for "Minimum Supported Rust Version". Many crates choose to support older versions of Rust, and so they set an MSRV.

Language concepts[edit]

UB[edit]

Main article: Undefined Behavior

Undefined behavior; writing code in a certain way allows the compiler to output any code it wants, and often causes memory safety bugs. Safe Rust can never cause UB, but unsafe code can.

ZST[edit]

A zero-sized type.

DST[edit]

Main article: Dynamically Sized Type

A dynamically-sized type, i.e. a type whose size is not known at compile time.

RAII[edit]

An acronym for "Resource Acquisition Is Initialization", a concept where all data types you have access to are initialized on creation and freed on destruction, so that no values are ever invalid. Idiomatic Rust code uses this extensively. Also common in the C++ world.

HKTs[edit]

An acronym for "Higher Kinded Types", a feature of Rust that is yet to be implemented, but has been discussed for many years. These 4 articles explain what they are used for, and what they might look like in Rust in the future:

HRTB[edit]

An acronym for "Higher Ranked Trait Bounds" - see Higher Ranked Trait Bounds for more info.

GAT[edit]

An acronym for "Generic Associated Types", an upcoming feature in Rust.

NLL[edit]

An acronym for "Non-lexical lifetimes", which use the MIR to make borrow checking more accurate and permissive. NLL were introduced in Rust 1.31 with the 2018 edition and backported to the 2015 edition in Rust 1.36.

ADT[edit]

An algebraic data type, i.e. a sum type (e.g. an enum) or a product type (e.g. a struct or tuple).

Syntactic sugar[edit]

A form of syntax that the compiler substitutes with a more general syntax. For example, if let is a syntactic sugar for match. The substitution of syntactic sugar to the most general form is called desugaring.

Compiler internals[edit]

AST[edit]

An acronym for the "Abstract Syntax Tree". The AST is created by parsing Rust code and expanding the macros.

HIR[edit]

An acronym for "High-level Intermediate Representation". The HIR resembles the AST, except that syntax sugar such as if let is already desugared in the HIR. The HIR is used for type checking.

MIR[edit]

An acronym for "Mid-level Intermediate Representation". When converting the HIR to the MIR, complex expressions are lowered to a sequence of instructions. The MIR is used for borrow checking. In the first Rust versions, the MIR didn't exist, so the borrow checker used the AST in older Rust versions.

Borrowck[edit]

The borrow checker. This part of the compiler validates lifetimes to ensure safety. For example, the borrow checker prevents use-after-free bugs and data races.

LLVM[edit]

LLVM is a modular compiler back end that handles code generation in Rust. The name is short for "Low Level Virtual Machine". LLVM was built originally for use in the Clang compiler. The current version used by Rust is LLVM 10.

LLVM IR[edit]

An acronym for the Intermediate Representation of LLVM. The LLVM IR is generated from the MIR.