Skip to main content

RECURSION_LIMIT

Constant RECURSION_LIMIT 

Source
pub const RECURSION_LIMIT: usize = 64;
Expand description

How deep explicit definitions may call each other before libjay stops them. Recursion that runs away is a program bug; the diagnostic says so rather than letting the process die on a stack overflow.

The number is set by the machine stack, not by the languages: one level of a definition costs about 24 kB of stack in an unoptimised build, so the guard has to fire well inside the 2 MiB a small thread gets. It can rise when the evaluator’s frames shrink.