Skip to content

Commit 10bd0a5

Browse files
committed
add background chapter topics to glossary, apply mark's suggestion
1 parent c442e27 commit 10bd0a5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/glossary.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,27 @@ The compiler uses a number of...idiosyncratic abbreviations and things. This glo
66
Term | Meaning
77
------------------------|--------
88
AST | the abstract syntax tree produced by the syntax crate; reflects user syntax very closely.
9+
bound variable | a "bound variable" is one that is declared within an expression/term. For example, the variable `a` is bound within the closure expession `|a| a * 2`. See [the background chapter for more](./background.html#free-vs-bound)
910
codegen unit | when we produce LLVM IR, we group the Rust code into a number of codegen units. Each of these units is processed by LLVM independently from one another, enabling parallelism. They are also the unit of incremental re-use.
11+
control-flow graph | a representation of the control-flow of a program; see [the background chapter for more](./background.html#cfg)
1012
completeness | completeness is a technical term in type theory. Completeness means that every type-safe program also type-checks. Having both soundness and completeness is very hard, and usually soundness is more important. (see "soundness").
1113
cx | we tend to use "cx" as an abbrevation for context. See also `tcx`, `infcx`, etc.
1214
DAG | a directed acyclic graph is used during compilation to keep track of dependencies between queries. ([see more](incremental-compilation.html))
15+
data-flow analysis | a static analysis that figures out what properties are true at each point in the control-flow of a program; see [the background chapter for more](./background.html#dataflow)
1316
DefId | an index identifying a definition (see `librustc/hir/def_id.rs`). Uniquely identifies a `DefPath`.
1417
HIR | the High-level IR, created by lowering and desugaring the AST ([see more](hir.html))
1518
HirId | identifies a particular node in the HIR by combining a def-id with an "intra-definition offset".
1619
HIR Map | The HIR map, accessible via tcx.hir, allows you to quickly navigate the HIR and convert between various forms of identifiers.
20+
free variable | a "free variable" is one that is not bound within an expression or term; see [the background chapter for more](./background.html#free-vs-bound)
1721
'gcx | the lifetime of the global arena ([see more](ty.html))
1822
generics | the set of generic type parameters defined on a type or item
1923
ICE | internal compiler error. When the compiler crashes.
2024
ICH | incremental compilation hash. ICHs are used as fingerprints for things such as HIR and crate metadata, to check if changes have been made. This is useful in incremental compilation to see if part of a crate has changed and should be recompiled.
21-
inference variable | when doing type or region inference, an "inference variable" is a kind of special type/region that represents value you are trying to find. Think of `X` in algebra.
25+
inference variable | when doing type or region inference, an "inference variable" is a kind of special type/region that represents what you are trying to infer. Think of X in algebra. For example, if we are trying to infer the type of a variable in a program, we create an inference variable to represent that unknown type.
2226
infcx | the inference context (see `librustc/infer`)
2327
MIR | the Mid-level IR that is created after type-checking for use by borrowck and trans ([see more](./mir.html))
2428
miri | an interpreter for MIR used for constant evaluation ([see more](./miri.html))
29+
quantified | in math or logic, existential and universal quantification are used to ask questions like "is there any type T for which is true?" or "is this true for all types T?"; see [the background chapter for more](./background.html#quantified)
2530
obligation | something that must be proven by the trait system ([see more](trait-resolution.html))
2631
local crate | the crate currently being compiled.
2732
MIR | the Mid-level IR that is created after type-checking for use by borrowck and trans ([see more](./mir.html))
@@ -43,3 +48,4 @@ token | the smallest unit of parsing. Tokens are produced aft
4348
trans | the code to translate MIR into LLVM IR.
4449
trait reference | a trait and values for its type parameters ([see more](ty.html)).
4550
ty | the internal representation of a type ([see more](ty.html)).
51+
variance | variance determines how changes to a generic type/lifetime parameter affect subtyping; for example, if `T` is a subtype of `U`, then `Vec<T>` is a subtype `Vec<U>` because `Vec` is *covariant* in its generic parameter. See [the background chapter for more](./background.html#variance).

0 commit comments

Comments
 (0)