Continuation
The primary computational primitive of TVM: a 'continuation' — pointer to a code segment plus execution context. Replaces conventional procedures and functions — every TVM control-flow primitive is built on continuations.
Aliases: tvm continuation
Continuation is the fundamental computational primitive of TVM, replacing the conventional notions of “function”, “procedure”, and “return address”. It’s a structure holding a pointer to a code segment plus execution context (stack, registers).
Why it matters
TVM has no CALL instruction in the Z80/x86 sense — only continuation manipulations. IFJMPREF { ... }, CALLREF, RETALT, and others all operate at the continuation level. This gives you:
- Higher-order functions in FunC/Tact/Tolk for free: a continuation is a first-class value.
- Try/catch through the
c2alternative continuation. - Loops via recursion or
WHILE { c1 } { c2 }combinators.
Why it’s strange coming from EVM
For developers arriving from EVM, this is the most unusual TVM concept. It’s worth reading TVM Whitepaper §4 (“Control flow, continuations, exceptions”) before writing your first non-trivial contract. Without understanding continuations you can’t really read a bridge or DEX’s TASM.