1. 13
  1. 7

    The upwards/downwards-infectious concept is interesting. It makes me think of covariance/contravariance … perhaps because downwards-infectious is caused by constraints on inputs (immutable) while upwards is caused by outputs (must be awaited.)

    I don’t see this as a bad thing about async, just a consequence of concurrency. Concurrency is inevitably difficult. We had threads and semaphores and mutexes and people said that was too hard. Then we had threads and synchronized methods and people said that was too hard. Then we had async callbacks and people said that was too hard. Then we had promises/futures and “then” functions and people said that was too hard. Now we have async/await and people still say it’s too hard… But it does seem to be getting better with every iteration, non?

    1. 2

      I don’t know if it is.

      Synchronized methods, async/await, and async callbacks all seem like regressions to me.

      1. 2

        …compared to what? Sucking it up and using plain mutexes? If so, I disagree…

        1. 1

          Condition variables and events. They work well to set up a graph of information flow among threads, rather than trying to mutate data in place.

          1. 1

            I’ll up the ante with: Actors with async/await.

            1. 1

              Drop async/await and you’ve got a deal.

    2. 2

      Funny how “infectiousness” of async is seen as some horrible flaw, but the same “color” limitation with purity is seen as a virtue.

      1. 4

        The difference is simple: with purity, the limitation is the goal. With async, it’s purely a nuisance.

        Lifejackets are useful on a boat, but not much fun when running a marathon.

        1. 3

          Yeah. This is why I can’t agree with the anti-monad sentiment in the comments; if we consider the situation in full light of codensity monads, then the connection between continuations and immediate actions is simplified to the point where we can see the entire system as one object and not as two worlds (the “async” and “sync” worlds) tied together by a special monad.