4 ms·
Async/await is specialised syntax for a more generic concept of monads which haskell was the language in which this was heavily researched. Specifically contin
by arianvanp 6y ago
Async/await is specialised syntax for a more generic concept of monads which haskell was the language in which this was heavily researched.
Specifically continuation monad describes asynchronous computation (promises) and was one of the motivating examples
In the early 90s going back all the way to Moggis original "notions of computations" paper from 1991
http://homepages.inf.ed.ac.uk/wadler/topics/monads.html http://homepages.inf.ed.ac.uk/wadler/topics/monads.html
Async/await and LINQ were the brainchild of Erik Meijer. A haskell researcher.
Also see https://news.ycombinator.com/item?id=25565229 https://news.ycombinator.com/item?id=25565229 from a recent discussion here.
Specifically http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.72.868&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.72.... where Eric tells his story about bringing haskell concepts to .NET
- daxfohl 6y agoFwiw, c# wasn't even the first dotnet language with it. F# had async computation expressions a few years earlier.
- sideeffffect 6y agoBut F# doesn't have async/await. As you write, it has "computation expressions", which are inspired by Haskell's "do-notation", but are more generalised and powerful (than both Haskell's "do-notation" or Scala's "for-comprehension", let alone async/await). One of the things I liked best about F#.
- daxfohl 6y agoIdk if you can strictly say that. Haskell allows more generalized do blocks because of HKTs. I blogged about this a few years ago. https://www.sparxeng.com/blog/software/higher-kinded-fun-in-haskell https://www.sparxeng.com/blog/software/higher-kinded-fun-in-.... (Granted, I've never had a use for that beyond code golf). And C# is nice because you can await anywhere in an expression instead of just at a "let!" declaration. This is something I do miss when using F#. But agreed, F# is usually my language of choice.
- daxfohl 6y agoI think the Haskell abstraction is what allows monad transformers. Saw some hacks in F# to allow similar, but you lose generic "lift", for instance.