Hacker News new | past | comments | ask | show | jobs | submit login

I, like many people in this thread, learnt about algebraic effects for the first time from the posted article. However, many commenters seem to be mislead by the explanation based on an example with exceptions. What I learnt from [1] linked below is that algebraic effects is a generalization of which language constructs like try/catch, async/await, or generators are just particular cases.

From that perspective, algebraic effects make sense and look very interesting.

[1] https://github.com/ocamllabs/ocaml-effects-tutorial




I tried to address this in the article but I guess people skipped over this?

>Note, however, that algebraic effects are much more flexible than try / catch, and recoverable errors are just one of many possible use cases. I started with it only because I found it easiest to wrap my mind around it.


Algebraic effects are synchronous; they can't be a generalization of async anything, because that uses threads.

A generalization has to do everything that the specialization does, like dispatch on multiple processors.

The synchronous version of async/await is delay/force; that is just macrology over some lambdas.


Not all implementations of async are thread-based. For instance, in C# it's task-based. In F# it's thread-based.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: