Skip to content

Comment on C++ Coroutine Theory (2017)parent

Comments

Coroutines are quite nice for managing sessions with asynchronous events, like stateful GUIs or client-server interactions. If you're familiar with the tendency of callbacks in e.g. JavaScript to nest deeply, you can think of coroutines as a way to recover a flat, procedural style.

I'm a particular fan of how coroutines work in Lua. Here's an article that helps explain them a bit in that context: http://leafo.net/posts/itchio-and-coroutines.html

Yeah, they're awesome for doing sequences of events that can have temporal gaps in the middle.

We used to use them(Lua) in games to do scripted sequences and AI. Was simple enough that even our designers could edit/extend them.

AboutSource Built by g1lg1l

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