News for hackers. Stuff that matters.
Re:Hurl: A terrible but cute idea for a language by ekidd on Monday June 19, 2023 @06:53PM (#36397452)
> call/cc is a single instruction that is sufficiently expressive to implement e.g. exceptions, coroutines and lots of stuff for which people typically use monad-style embeddings.

The flip side of this is that call/cc prevents you from relying on a stack, except in cases where you can do heavy static analysis. And you virtually never need the full power of call/cc unless you're implementing coroutines.

This is the main reason that so few languages support call/cc: stacks are a nice implementation technique (as opposed to GCed activation records on the heap), and call/cc comes with a heavy price for very situational value.

One alternative are "escape" continuations, which can only be used during the lifetime of the creating block. These are stack friendly.

There are no comments on this comment yet.