Coroutines in Lua

Ana Lúcia de Moura, Noemi de La Rocque Rodriguez, Roberto Ierusalimschy · 2004

After a period of oblivion, a renewal of interest in coroutines is being ob- served. However, most current implementations of coroutine mechanisms are restricted, and motivated by particular uses. The convenience of providing true coroutines as a general control abstraction is disregarded. This paper presents and discusses the corou- tine facilities provided by the language Lua, a full implementation of the concept of asymmetric coroutines. It also shows that this powerful construct supports easy and succint implementations of useful control behaviors.

Read the paper · More papers on PaperTik