Tail applications replace the current evaluator frame in an explicit trampoline, so self and mutual tail recursion do not grow the logical continuation.
At a glance
LISPEX
(let loop ((n 10000) (acc 0)) (if (= n 0) acc (loop (- n 1) (+ acc 1))))Result
OUTPUT
10000Current guarantees
- Tail positions include final bodies, both
ifbranches, normalizedcond/case, finaland/or,do,call-with-values, andapply. - Proper tail behavior concerns continuation growth, not equal wall-clock time or unlimited execution.
- Resource limits remain deterministic and profile-specific even for tail-recursive programs.
Boundaries
- Non-tail recursion may reach the declared resource limit.
- A clean resource fault is not evidence that native and WASM have the same threshold.