Trampolines

/ˈtræmpəˌlinz/ noun

Definition

A programming technique used to implement tail-call optimization in languages that don't natively support it. Functions return continuation objects instead of making direct recursive calls, preventing stack overflow.

Etymology

The metaphor comes from the bouncing motion of a trampoline, coined in the 1970s by computer scientists. Just as a trampoline bounces you back up instead of letting you fall through, the technique 'bounces' function calls back to a loop instead of letting them accumulate on the call stack.

Kelly Says

Trampolines are like having a safety net for recursion - instead of diving deeper and deeper into function calls until you hit the stack limit and crash, each function call 'bounces' back to a central loop that decides what to do next! This lets you write recursive algorithms that can run forever without running out of memory.

Related Words

Explore More Words

Get the Word Orb API

Complete word intelligence in one call. Free tier — 50 lookups/day.