News for hackers. Stuff that matters.
Re:A Field Guide to Lua Coroutines by vaughan0 on Monday July 01, 2013 @02:32PM (#5972646)
> "The main limitation of Lua coroutines is that, since they are implemented with setjmp(3) and longjmp(3), you cannot use them to call from Lua into C code that calls back into Lua that calls back into C, because the nested longjmp will clobber the C function’s stack frames. (This is detected at runtime, rather than failing silently.)"

Lua 5.2 provides a mechanism to help with this: http://www.lua.org/manual/5.2/manual.html#4.7

Re:A Field Guide to Lua Coroutines by silentbicycle on Monday July 01, 2013 @02:56PM (#5972810)
Thanks. :) I'm still mostly using Lua 5.1.4 most of the time, and I forgot to include that.
Re:A Field Guide to Lua Coroutines by dottrap on Thursday July 04, 2013 @07:55PM (#5992928)
There is also a modification patch for Lua 5.1 called Cocos that fixes this. It was written by Mike Pall, better known as the author of LuaJIT. http://coco.luajit.org
Re:A Field Guide to Lua Coroutines by silentbicycle on Saturday July 06, 2013 @01:44AM (#5998097)
I saw a patch he wrote for copying coroutines, for those who miss multi-shot continuations.