Could JavaScript have synchronous `await`?
Briefly

The blog post discusses the complexities that arise from the separation of synchronous and asynchronous code in JavaScript. It highlights duplication of functionality, as seen in various iterator methods and the existence of both synchronous and asynchronous generators. The author argues that this separation creates challenges for API design, particularly when it comes to writing synchronous parsers that can't leverage asynchronous capabilities. It suggests that resolving these issues may be possible if 'await' can be integrated within synchronous code, paving the way for smoother code execution and user experience.
The main issue is that synchronous code cannot call asynchronous code, leading to duplication and complications in API functionality, especially when plugins require asynchronous operations.
Using tools like quansync can simplify the process, but it still doesn't allow for an integration of async code directly within sync code, highlighting a core limitation.
Read at 2ality
[
|
]