~/talk

Taming the stack

Talkat PureConf 2022 · on Thursday, 2022-02-24· [functional-programming]
links:none on file
slides:none on file

Shows how any first-order non-tail recursion becomes a tail-recursive loop by applying a worker‑wrapper, CPS to named continuations, turning closures into an explicit continuation data type and a single eval loop, producing a constant‑stack implementation. Presents alternatives: a tail-recursive loop using explicit constructors (about 6–8× slower than naive recursion) and a trampoline monad that handles higher‑order recursion but runs ~25–50× slower. Derives the same result via least/greatest fixed points and a free monad‑style trampoline; all approaches are stack‑safe and practical tradeoffs.

AI-written summary · about

  1. 0:00Start
  2. 0:15STACK SAFETY
  3. 5:43AN EXAMPLE
  4. 6:53A TRANSFORMATION
  5. 13:19TAILREC
  6. 14:46GREATEST FIXPOINT
  7. 18:25LEAST FIXPOINT
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.