lua-users home
lua-l archive

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




On Thu, Nov 17, 2011 at 3:28 AM, Axel Kittenberger <axkibe@gmail.com> wrote:
_javascript_ 1.7 (Mozilla) has generators which is eventually the same
thing as coroutines (just a tad more ugly to look at :-), but you are
restricting yourself to Mozilla/Spidermonkey then.

"ECMAScript Harmony" plans to have generators
http://wiki.ecmascript.org/doku.php?id=harmony:proposals

But who knows if this is going to be a consensus or a drama like ECMAScript 1.4

The same goes for 'let' which ought to provide proper lexical scoping.
Available now in Mozilla/Spidermonkey only, might be in a future
ECMAScript, might also be not.


With some tricks, I believe providing Lua-like lexical scoping is possible in regular _javascript_ and allows this project to stay compatible with pretty much any browser that supports _javascript_. Still, maybe for the runtime code generation it could use a faster option if it's available.