Skip to content

Comment on Lapis – A Lua, Moonscript Framework built on OpenRestyparent

Comments

I don't know how Lapis does it, but it's not difficult to write a coroutine-cloning function in C for Lua:

http://lua-users.org/lists/lua-l/2006-01/threads.html#00650, cf. thread "coroutine.clone and stateful web applications".

(Coroutines are essentially one-shot continuations; if you can clone them, you can bookmark execution states at will. Look at Lua's upvalue semantics to anticipate what will happen to variables shared by multiple coroutine clones).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.