Plans for async await

This is probably a good time to have a fresh discussion on the plans for async await or a suitable alternative as the ocaml monadic let operator syntax has been concluded as something that won’t be pursued as it doesn’t align with the goals of resript.

Would be good to have clarity on what the plans are for this as this is a key language area?

(PS the promise code in the docs is using pipe last which has a deprecated notice in the pipe section)

9 Likes

Resurrecting this because I’m really curious for new updates on the async await syntax.

5 Likes

We had multiple internal (and public) discussions about possible solutions for a well designed async / await feature, but so far we weren’t really happy with the available options.

The conclusion for now is that we will polish the Promise based approach (get rid of the old promise docs and temporarily refer to the easy-to-vendor / easy-to-install rescript-promise instead, until we can upstream it to the compiler), and let time pass as we get a clearer picture on proper async handling.

This doesn’t mean we will shut down discussions on this; it just means that there won’t be any concrete implementation any time soon.

Current focus of the project is to reduce unnecessary code as much as possible to make the platform more reliable and easy to maintain, while working on some other milestone tasks.

9 Likes

It may have already been suggested but what about something a la F# (async computation expressions)?
Seems quite an elegant approach.

1 Like

Check out implement monadic syntax sugar · Issue #1326 · rescript-lang/rescript-compiler · GitHub for previous discussions.

2 Likes