Hacker News new | ask | show | jobs
by dblohm7 3807 days ago
One caveat with coroutines and fibers is that all the code that runs on them must be fully aware that they are running on said coroutines and fibers.
3 comments

Under what language / toolkit? Folks are pointing out counterexamples below and I could name a few myself, but I'm curious where you're coming from :-)
at least in java (i'm using https://github.com/kilim/kilim, but quasar appears to be similar), only methods that yield need to be aware
Same for Lua.
Not true if one is using Haskell (or any other sufficiently expressive language)
That has nothing to do with Haskell's expressivity and everything to do with its full purity. If you look at, say, OCaml, the code (or at least the libraries) must also be aware that it's running in a fiber, just as in Java, Go or Erlang.

While full purity has its virtues, it also has serious drawbacks, and it's unclear at this point whether or not at the end of the day purity is a net-gain, neutral, or even a net-loss.