Hey guys, I'm writing a Babel plugin to be able to use algebraic effects in JS
https://github.com/macabeus/js-proposal-algebraic-effects<p>No more function color! Yes one-shot delimited continuation!<p>What the hell?! Well... I really recommend that you read this blog post by Dan Abramov explaining algebraic effects - and how it could be very useful on our JavaScript code: https://overreacted.io/algebraic-effects-for-the-rest-of-us/<p>This project is a runnable POC with a Babel's "plugin", so you could write some code and taste this new concept in JavaScript. Its features, syntax, and goals are very inspired by Dan Abramov's blog post mentioned above. In short, with algebraic effects, you could separate what from the how and have fewer refactors.<p>What do you think? Would that be a good feature for JS?
So instead of requiring the callee to be async or not you have to make sure your caller is executing in the right effect handler context? Sounds like we replaced the coloring problem with another one? I can see how it benefits the language designer because you could implement try catch and async with this but how does it benefit the user?
Since JS lacks a static type system, isn't it a bit misleading to call these "algebraic" effects, when algebraic is referring to the type system? I'm still not clear where the "algebraic" part comes in here.