F# Async is not implemented in terms of Promise (and so async/await) in WebSharper, presumably for the same reason as in Fable: the semantics are different. An Async instance is a "cold" computation, which can be started an arbitrary number of times; whereas a Promise is a "hot" computation, which is potentially already running, and once it has returned a result then that's it. Promise is much closer to C# Task in that regard.

As for having a syntax for working with promises, like Fable's promise computation expression: that's definitely something that can be added. Enhancement issues and PRs are welcome!

By on 6/22/2018 9:48 AM ()

If I'm not wrong Fable is a compiler for F# only while WebSharper transpiles also C# (with Task, async/await, ...).
Anyway I see that the docs explain that Async is transformed into nested callbacks and I guess the reason is simply that the JavaScript extension implements the full 5th edition of the ECMA standard (as per the github repo source code), while promises appear in ES6. Not sure how many people are interested in the promisification of those nested callbacks, since the only benefit would be (AFAIK) just in terms of readability on one side and how many need ES5 for backward compatibility on the other hand.

By on 6/22/2018 1:17 PM ()