lua-users home
lua-l archive

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


On Sun, Jan 28, 2018 at 1:09 PM, Tony Papadimitriou <tonyp@acm.org> wrote:
...
> The only thing I would certainly add to Lua is a `yield` keyword to
> complement `return` similar to Python’s way.
>
> The current method (or hack) of implementing co-routines is unnecessarily
> verbose and often resulting in hard to understand code.

How do you think this will improve? One of the reasons I'm currently
using lua is for it's coroutine support. I've used yield in python,
great for one liners not so for real world stuff ( my yields are
buried deep in the libraries I use to linearize event loops to
coroutines, I looked at python and it didn't have anything aproaching
real coroutines ( except for stackless ), and I'm still trying to
understand how to use those fancy "async" thingies they have come up
with.

In lua? coroutines are what they have been in nearly every other
system I've used, same functions as packages I've used in C, C++,
pascal and even assembler ( 8 bit one ). Nothing especial to be done
in any function used in a coroutine heavy program, just a couple
function calls.

Francisco Olarte.