Glossary

Every term the curriculum uses, defined once, with the chapter that develops it.


A–C

Adaptive specialization — Rewriting an instruction based on observed types, and rewriting it back when the observation stops holding. Without the "back", a polymorphic site thrashes. → Runtime Specialization

AST (abstract syntax tree) — The tree the parser produces. Abstract because syntax that only affected the shape (parentheses, keywords) is discarded once the shape exists. → The AST

Backpatching — Emitting a jump with a placeholder target and filling it in once the target is known. Ember's placeholder is u32::MAX, because 0 would be a valid jump to the top. → Code Generation

Base (of a frame) — The value-stack index of a frame's slot 0. GET_LOCAL s is stack[base + s]. → Functions and Frames

Binding power — The number expressing how tightly an operator pulls on its operands. Two per operator; their asymmetry encodes associativity. → Grammars and Precedence

Bytecode — A linear instruction sequence for a virtual machine. Ember's is a Vec<Op> where Op is an 8-byte Rust enum. → Instruction Set Design

Call frame — Three numbers: which function, where its slots start (base), and where its instruction pointer is. Not a container — a window onto the shared value stack.

Capability — A permission the runtime grants explicitly. Nothing is available unless registered, which makes a forgotten registration a nil rather than a hole. → The Standard Library

Chunk — A compiled unit: code, constants, a line table, and nested protos.

Closed upvalue — An upvalue that owns its value on the heap, because the stack slot it pointed at is gone. → Upvalues

Closure — A function plus the variables it captured. Captures the variable, not its value, which is why two closures over one variable share it. → Closures

Constant pool — A per-chunk array of literal values, referenced by index. Deduplicated, and for floats keyed by bits so that NaN dedups and 0.0/-0.0 do not merge.


D–G

Deoptimization — Reconstructing interpreter state from an optimized frame when a guard fails. The price of speculation, and most of the engineering in a JIT. → JIT Architecture

Determinism — Same script, same inputs, same output, on every machine. In Ember a designed property, not an accident: it decided the recursion limit, the execution budget, table iteration order, string ordering, and the exclusion of math.random.

Differential testing — Running two independent implementations on the same input and requiring agreement. Ember's highest-leverage test, and its blind spot is code the two implementations share. → The Reference Implementation

Dispatch — Getting from an opcode to the code that implements it. One indirect branch per instruction; historically the dominant interpreter cost, and less so on modern predictors than the folklore suggests. → Dispatch

Escape analysis — Deciding whether a local outlives its frame, and therefore whether it must be heap-allocated.

Frame stack — Vec<CallFrame>. Making frames data rather than Rust stack frames is what turns a stack overflow into a Result and makes coroutines possible.

Generation counter — A per-slot version number bumped on free, so a stale handle is a clean error rather than silent corruption.

Golden test — A program plus its expected output. Ember's corpus is shared by every backend, so every golden case is automatically a differential case.

Guard — A cheap runtime check protecting an assumption an optimization made. Every speculation needs one, and a way back when it fails.


H–M

Handle (GcRef<T>) — An 8-byte {index, generation} into the heap's slot table. Not a pointer: bounds-checked by construction, which is what allows a tracing collector with zero unsafe. → Value Representation

Inline cache — A per-call-site cache of a lookup's answer plus a guard on the shape it assumed. Mono / poly / megamorphic. → Inline Caches

Interning — Keeping one heap object per distinct string content, so equality is a handle comparison. Added only after a benchmark said so (ADR-007).

Line table — One Span per instruction. As large as the code itself; Lua and CPython compress it, Ember does not (yet), and the reason for deferring is that it is invisible outside Chunk.

Maximal munch — At each position, take the longest token that matches. Why .. is one token and not two.

Megamorphic — An inline-cache site that has seen too many shapes. Terminal — it must stop trying, or it pays both the cache-update and the lookup cost.

Metamethod — A hook in a metatable, consulted when a primitive operation would otherwise fail. The "otherwise" branch of every operation. → Metatables

Multret — The sentinel meaning "however many values there are". Biased in the encoding so it cannot collide with a real count.


N–R

NaN boxing — Packing a tagged value into 8 bytes by hiding it in unused IEEE-754 NaN bit patterns. Rejected as Ember's default (ADR-004); capstone project 2 measures it.

Open upvalue — An upvalue still pointing at a live stack slot. Shared by every closure over that slot, which is what makes the sharing in make_counter work.

Pratt parsing — Expression parsing with one function, a minimum binding power, and a table. Also called precedence climbing. → Recursive Descent and Pratt

Proto — The immutable, shared compiled form of a function. One per function expression, regardless of how many closures are made from it.

Root set — A place the collector starts marking from. Ember has nine, and three of them (constant pools, the intern table, host handles) are not the value stack. → Garbage Collection


S–Z

Safepoint — A place where a collection may run because the VM's state is consistent. In Ember, only at allocation.

Slot — A numbered position in a frame. What a variable name becomes at compile time — the single largest reason a bytecode VM beats a tree walker.

Span — A half-open byte range [start, end) into a source file. 8 bytes, Copy, attached to every token, node, and instruction. The thread that connects a runtime failure to a character.

Stack machine — A VM whose instructions take operands implicitly from an operand stack. Ember's choice (ADR-002); makes code generation a post-order walk and stack-depth verification a counter.

Stack map — A record of which registers and stack slots hold GC references at a safepoint in compiled code. What lets a collector find roots inside a JIT frame.

Superinstruction — A fused sequence of instructions. Unlike a specialization it needs no guard, because it assumes nothing about types.

Tagged union — A fixed-size cell carrying a type tag and a payload. Ember's Value is a 16-byte Rust enum.

Tri-color marking — White (unreached), grey (reached, children unscanned), black (done). The invariant — no black→white edge without a grey path — is free for a stop-the-world collector and is what a write barrier maintains for an incremental one.

Upvalue — The box holding a captured variable. Open (pointing at a stack slot) or closed (owning the value on the heap).

Userdata — A host object owned by the engine, with a type tag and a per-type metatable. How a Rust struct becomes article.semantic_score without a copy.

Validator — A single pass over a Chunk checking nine structural rules, including an abstract interpretation of stack depth. What makes a bytecode cache safe — and Ember's best compiler-bug detector.

Write barrier — Code running on every pointer store into a heap object, maintaining the tri-color invariant for an interruptible collector. The price of incrementality.


Next: Opcode Quick Reference.