4 ms·
I think so, yes. However, I'd attribute that to F# having the first implementation and not enough clout to influence the central .NET implementation, like C# di
by btschaegg 8y ago
I think so, yes. However, I'd attribute that to F# having the first implementation and not enough clout to influence the central .NET implementation, like C# did. AFAIK, there's another computation expression builder using Task<T> in FSharpx that performs better.
However, since in C#, async functions also seem to boil down to monadic continuations, I see no obvious reason the F# way couldn't be optimized to the same degree (given enough determination and resources).
If there's anyone here with insight into the `async` implementation that knows otherwise, I'd really appreciate a comment on this :)
Edit: Andrei Alexandrescu had a nice latin phrase on this in a talk at DConf 2018[1]: «Quod licet iovi non licet bovi». There, he's basically arguing the same thing: It is very often more desirable to give the language user a tool they can use themselves instead of reserving it only for the language implementers.
[1]: https://dconf.org/2018/talks/alexandrescu.pdf https://dconf.org/2018/talks/alexandrescu.pdf Page 4