4 ms·
Wow Algebraic Effects are a totally new thing i never seen mentionned so far I always thought that async /await was the best known way to handle resumable compu
by dgan 5y ago
Wow Algebraic Effects are a totally new thing i never seen mentionned so far
I always thought that async /await was the best known way to handle resumable computation
Totally blew my mind
- Smaug123 5y agoFor more mind-blowing stuff, try learning F#, where async/await as a language feature is something you could implement entirely in user-space (though of course you need to access the .NET APIs if you want to implement parallelism). F# has "computation expressions", which allow you to define syntax for fully-general "monad-like things", and the built-in `async` computation expression is just a part of the standard library and is defined using that mechanism. I imagine exposure to algebraic-effects systems must make one feel the same way: like it's such an awful hack when a language has to have async support baked into its syntax!
- yawaramin 5y agoFYI, OCaml also has library-level async/await implementations (e.g. Lwt), and something similar to computation expressions (let-operators).