I'm sharing a draft article "Structured concurrency and Lua (part 1)".
After the long road of lobbying for scope exit hooks in Lua (begun around the time of the Lua Gems book, in 2008), it's been nice to finally have the feature and apply it to problems. What I couldn't imagine in 2008, however, is that one would ever want to yield from scope exit. But Lua can do that now too, enabling interesting possibilities, such as the structured concurrency presented in the article.
Feedback is welcome here or on github. (Encouragement also, if you'd like to see the series continue.)
Regards,
--John