Comment

Comment by lisper

Right. The way it was explained to me years ago that really stuck with me is that one way to implement call/cc is to copy the stack onto the heap.

(And another way to do it is to simply allocate all your function call frames on the heap to begin with and not have a stack. Then call/cc is essentially free, but you need a really good incremental garbage collector because now every function call conses.)

parent lisper 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton