Skip to content
blake2-ppc edited this page Oct 3, 2013 · 39 revisions

This is currently a work in progress - feel free to alter or add definitions as necessary.

term definition
attribute A way of adding metadata to an item. Written as #[attribute_name] (other examples being #[doc="Foo"], #[doc(hidden="true")]).
bikeshed A highly important discussion about some non-fundamental part of the language (such as syntax or identifier names).
borrowed pointer Also known as a "reference". It references an object without taking ownership of it. Has an associated lifetime, to assert that it is always valid.
bors The name of our continuous integration bot, a Python script that checks for reviewed pull requests and runs the test on it, merging it if they pass.
box An allocated chunk of memory.
built-in trait A compiler-defined trait that is implicitly implemented for each eligible type. They are Send, Freeze and 'static.
closure Refers both to the type (&fn, ~fn) and the literal notation: ∣args∣ expression (where expression can be a block, ie ∣x∣ { println(x.to_str()); 5}). It is said to "close over" its environment; it can "capture" values from surrounding code. (Note: This is using a non-pipe unicode character because github doesn't like using that character in tables.)
crate Rust's compilation unit, a single library or executable. Is the root of a namespace.
FFI See foreign function interface.
foreign function interface Calling code written in another language. Rust has a native C FFI, using extern "C" fn.
heap allocation A dynamic allocation performed either by ~ or @, which call to malloc in the default runtime (which is a statically-linked jemalloc).
inlining Inlining is removal of a function call by including the function body directly into the callsite, enabling further optimizations. Controlled with the inline attribute: #[inline(never)], #[inline] for a standard (though very strong) inline hint, and #[inline(always)]. Note that #[inline] is required for cross-crate inline.
Intermediate Representation LLVM IR Code. It can be printed by passing-S -emit-llvm to the compiler.
IR See Intermediate Representation.
IRFY Is Rust Fast Yet. Graphs tracking how long the buildbots take to build + test. Also see its companion, Is Rust Slim Yet.
lifetime A piece of metadata that borrowed pointers have. They reference the scope that the pointer is valid for.
macro A type of syntax extension, defined with macro_rules! name_of_macro. Are a way of declaratively generating Rust from arbitrary tokens. For example, assert!, debug!, and fail! are macros. The standard macros can be found here.
managed pointer @T, a pointer to a mutable, garbage-collected box.
monomorphise The act of generating specialized versions of generic constructs at compile time to improve run time performance. See Whole-Program Compilation in MLton and Niko Matsakis's answer on Stackoverflow.
newtype struct A tuple structure with a single unnamed field. For example struct NodeIndex(int). Useful to create wrapper types.
owned pointer ~T, a pointer to an owned box.
raw pointer *T, a pointer to anything. Requires unsafe code to dereference, no static verification is done on them.
rustdoc The Rust documentation generator.
rustc The Rust source code compiler.
rusti The Rust interactive environment.
rustpkg The official package manager for Rust programs and libraries.
sigil A character placed in front of a type, identifier or literal. In the context of Rust, this usually refers to the pointer symbols: &, ~, @, and *.
stack allocation All local variables are a stack allocation.
syntax extension Code generation at runtime, broken into three groups: declarative macros, which are described above as macros; procedural macros, which are written as Rust code that processes a token tree and produce an AST (currently requires editing the compiler), and attributes.
task Rust's fundamental unit of computation. Similar to a thread but far more lightweight.
trait Rust's approach to ad-hoc polymorphism, and used for generics and dynamic dispatch. Also known as type classes.
tuple structure A struct declared without named fields, for example struct Point(f32, f32)
TWiR This Week in Rust. cmr's weekly summary of Rust's development.
type hint A syntax like foo::<int>() to give an explicit type for a generic function, method or struct constructor. Usually redundant due to type inference.
unit type The unit type, denoted (), permits only one value, also denoted (). Functions without return value have return type (). Sometimes called nil.
unit-like structure A struct that only has one value, for example struct Foo; where Foo becomes the name of both the type and its only value. Works just the same as the unit type (), except it is distinct.

Syntaxicon

What is the syntax called?

syntax name
() The unit type.
'static, 'self, 'a A lifetime. May also be used to name a loop or a for clause.
~T If T is a type, an owned pointer to T.
&T, &'a T If T is a type, a borrowed pointer to T, possibly with a lifetime.
~fn() An owned closure.
&fn() A borrowed closure.
&[Foo], &'a [Foo] A vector slice with element type Foo and possibly with a lifetime.
~[Foo] A vector.
~Trait:Send A trait object where :Send are the trait bounds.
foo!() Either a macro or syntax extension.
#[xyz] An attribute.
::<int> A type hint.

All Categories:

Clone this wiki locally