amoroso,
@amoroso@fosstodon.org avatar

Can you recommend any general learning resources on coroutines?

I'm looking for tutorials, books, or other non-video sources that are largely language independent (or introduce a few primitives clearly) and, most importantly, explain how to program with couroutines and for which problems or situations they're typically used. I'm looking to learn the concepts, not features of specific languages.

I'm not interested in other control or concurrency primitives.

CGM,
@CGM@mastodon.scot avatar

@amoroso "Revisiting Coroutines" by the Lua people is perhaps more theoretical than you want but might be worth a look - https://www.inf.puc-rio.br/~roberto/docs/MCC15-04.pdf

amoroso,
@amoroso@fosstodon.org avatar

@CGM It seems interesting and close to what I was looking for, thanks.

jkmcnk,
@jkmcnk@mastodon.social avatar

@amoroso not really sure what level are you looking for, but there's marlin's thesis in LNCS, https://link.springer.com/book/10.1007/3-540-10256-6

amoroso,
@amoroso@fosstodon.org avatar

@jkmcnk Thanks, I don't have access to the publication but it seems a bit too much. I meant something like this:

https://mastodon.scot/@CGM/111879218984267583

felix,
@felix@wandering.shop avatar

@amoroso I can offer a concrete example if it helps: in AntiWiki I use a coroutine (technically a Python generator function, same difference) to implement text search across a complex data structure, where you can't just store an index position. You have to pick up again from the same place in the code, stack frames and all, every time the user picks "find next".

amoroso,
@amoroso@fosstodon.org avatar

@felix Thanks, that's interesting because generators are most often presented in the context of lazy evaluation.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • slotface
  • kavyap
  • everett
  • Durango
  • osvaldo12
  • rosin
  • thenastyranch
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • InstantRegret
  • Youngstown
  • ngwrru68w68
  • anitta
  • megavids
  • normalnudes
  • ethstaker
  • cisconetworking
  • tacticalgear
  • khanakhh
  • cubers
  • GTA5RPClips
  • provamag3
  • modclub
  • Leos
  • tester
  • JUstTest
  • lostlight
  • All magazines