lua-users home
lua-l archive

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


> > But Lua 4.1 will not be "stackless"; that would compromise its neat
> > integration with C.
> 
> Will it be internally stackless?

No.


> Presumably the hard bit is making it stay stackless when it calls C;

The problem is that there are lots of places where Lua can make a 
call to C. Any tagmethod can be a C function, and so most basic operations 
may call C. Currently we handle calls to C and to Lua in the same way. 
To change that would break a nice "simetry" in the code, and would need
lots of changes in the code. (It could also compromise performance...)

We had three goals in mind: restricted co-rotines (only Lua), generic 
co-routines, and multi-thread. Lua stackless would demand lots of work, and 
would solve only the first goal; it would be useless for the other two. 
Multiple stacks solves the other two goals (with a small external help), it 
is quite simple to implement, and has no impact in performance. 

-- Roberto