lua-users home
lua-l archive

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


On Wed, 22 Aug 2007, Fabien wrote:
>
> Exec summary: first class continuations are the only powerful metamechanism
> which hasn't made it into Lua, unlike in its sibling Scheme. I've always
> been slightly surprised that they didn't, as they fit quite well into Lua's
> spirit of empowering through very generic metamechanisms. I'd guess they
> reasons why they didn't are largely historical (?)

First class continuations are lots of fun, but they have serious
performance implications. If you implement them by putting all activation
records on the heap, then you seriously stress the garbage collector, some
CPU caches will go seriously slow because of the way they handle write
misses, and (if you compile to native code) you won't be able to benefit
from call stack optimisations.

Tony.
-- 
f.a.n.finch  <dot@dotat.at>  http://dotat.at/
IRISH SEA: SOUTHERLY, BACKING NORTHEASTERLY FOR A TIME, 3 OR 4. SLIGHT OR
MODERATE. SHOWERS. MODERATE OR GOOD, OCCASIONALLY POOR.