lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> > The weird performance implications caused by first-class continuations are
> > the need for a garbage-collected stack, or an expensive stack-copy
> > operation when a continuation is used in a difficult manner.
> >
>      Several implementations of first-class continuations only have an
> extra cost if you use them. Even so, full, unbounded stack copies are
> the most naive implementation and not used in good compilers.

Lua cannot afford what you call a "good" compiler. Coroutines give us
most of the advantages of continuations (as they are equivalent to
one-shot continuations) with a trivial implementation.

-- Roberto