The status of eio and effects composition

This is coming up again and again, here’s my attempt to summarize the current state of discourse.

@mefyl showed good motivation for the feature: we have two logically concurrent tasks. Both of them might want to use async IO (as provided by Eio), and both of them might want to use other effects.

Currently, Eio has a global scheduler, and threads are to be thought of like system threads that might even run on another core, therefore they can’t inherit the context. But sometimes what we want is like a local while loop that tries to run one thread until it blocks, then run the other thread until it blocks and repeat. In this case, both threads sharing the evaluation context (and with that outer handlers) is no problem. Effects let us easily do this in direct style reusing the same interface.

If I understand @art-w correctly, Eio needs to have some support for cooperating with such local schedulers, but it does work.

2 Likes