Skip to content
0:00 / 0:00

#tailcalloptimization#recursion#callstack

!!Con 2019- Tail Call Optimization: The Musical!! by Anjana Vakil & Natalia Margolis

Confreaks

42K subscribers • 74 videos on Hallway • Conference channel

YouTube
  • Recommended by 1 person: 1 on Lobsters.
  • Presented by Anjana Vakil & Natalia Margolis

Beginner. No background in the topic needed.

99K views7 years ago1 recommendation

Programming languagesSystems programmingCompilers and interpretersJavaScriptFunctional programming

Anjana Vakil and Natalia Margolis explain recursion, the call stack, and tail call optimization through a musical performance.

!!Con 2019- Tail Call Optimization: The Musical!! by Anjana Vakil & Natalia Margolis “Stack overflow”! “Maximum call stack size exceeded”!! “Too much recursion”!!! You may have seen errors like these thrown when you attempt to run a deeply recursive function. Computers can be so dramatic! But what’s the conflict, exactly, between recursion and call stacks? And is there any hope for resolving it into a happy ending? In this musical talk we’ll see why recursion poses a problem for the finite-memory call stack in our language runtime (we’ll use a JavaScript engine as an example), and learn how “Tail Call Optimization” (TCO) - a particularly cool implementation feature of some engines - lets us get around that problem, when paired with so-called “tail-recursive” functions. We’ll sing our way through the meaning of these terms to explore how TCO messes with the call stack (in a useful way!), as we mess with the lyrics to some of our favorite animated musical songs (in a nerdy way!).

Why it's here

1 person recommends this

What people say. Recommended as a highly entertaining and creative explanation of tail call optimization and call stack mechanics.

pushcxon Lobsters • Recommends

Tail Call Optimization: The Musical