The newly released bluefin-algae is a library for algebraic effects in the Bluefin effect system.
-
Algebraic effects are a primitive for user-defined effects. For the price of one computational effect (delimited continuations), get all of them! The README gives examples of concurrency and backtracking that would seem to require some fancy monads, but it’s just IO underneath with nothing other than the delimited continuations primitives.
-
Bluefin enables a particular flavor of effect handlers: “named effect handlers” (or “statically scoped effect handlers”) which have been discussed in recent literature (see references in the README), but as far as I can tell, more experimentation is necessary to better understand how that compares in practice to the dynamic scoping of effect handlers in most other systems. (One might hope that some of the reasons for preferring static scoping of variables also apply to the scoping of effects.)
-
One flaw of this implementation is that effectful operations traverse the stack to capture the continuation. Are there algebraic effect systems that avoid this issue? To give a non-example in case you’re wondering, OCaml Multicore, in spite of having a fancy call stack structure, must still do a linear search for a matching handler (this is arguably the fault of the dynamic scoping of effects!). For another non-example, effectful and bluefin don’t deal with delimited continuations (they are not “algebraic effect” systems).