lua-users home
lua-l archive

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


David Kastrup <dak@gnu.org> wrote:
> Tony Finch <dot@dotat.at> writes:
> > David Kastrup <dak@gnu.org> wrote:
> >>
> >> You need good garbage collection.  Having a bad garbage collector and
> >> hoping it will not show too much is not a good option for dynamic
> >> languages with or without continuations.
> >
> > I think you should look at the relative frequency of table allocation,
> > closure allocation, and function calls in typical Lua code.
> >
> > Most dynamic languages have crappy garbage collectors.
>
> Since you are objecting to continuations in Lua rather than some
> hypothetical dynamic language, your argument would apply when you
> consider Lua's garbage collector crappy.  What particular performance
> degradation do you expect from it?

My comment about crappy garbage collectors was to reinforce my point that
dynamic languages stress GC much less than functional programming
languages. Lua's GC is much better than most others.

We agree that continuations work best with a bump allocator, which
requires a moving GC. Lua's GC doesn't move objects so it would need
rewriting. Maybe you could keep the current GC for most objects and
add a new one for local variables, closures, upvalues, and so forth.

Lua would need much more memory reserved for its stack, to provide space
for call frames that are not immediately reclaimed.

I can't think of anything that is likely to become noticably simpler.

http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.39.8219
http://home.pipeline.com/~hbaker1/CheneyMTA.html
http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.18.2789

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
Biscay: North or northwest 4 or 5, occasionally 6 later. Slight or moderate.
Thundery showers. Good, occasionally poor.