Is there an existing proposal for this?
This feature does not exist in the latest version
Proposal
Important: This does not propose the implementation of the Promise API built into JS, but rather the basic high-level async API allowing the designation and calling of Async functions, such as built-in fetch()
As Kipper is currently only running in sync mode, it is unable to perform proper non-blocking web requests which await the response of a given web server. To fix this, Kipper should start its async implementation with a simple async def, -> Promise<T> and await T() syntax and compiler support. These functions will as expected return a standard Promise, which then can be called using await. Calling an async function with await is therefore not necessary and can be stored in a variable if required.
Exact behaviour / changes you want
Is there an existing proposal for this?
This feature does not exist in the latest version
Proposal
Important: This does not propose the implementation of the Promise API built into JS, but rather the basic high-level async API allowing the designation and calling of Async functions, such as built-in
fetch()As Kipper is currently only running in sync mode, it is unable to perform proper non-blocking web requests which await the response of a given web server. To fix this, Kipper should start its async implementation with a simple
async def,-> Promise<T>andawait T()syntax and compiler support. These functions will as expected return a standardPromise, which then can be called using await. Calling an async function withawaitis therefore not necessary and can be stored in a variable if required.Exact behaviour / changes you want
asyncprefix keyword for function definitions, which enables an enforced compiler rule that the function must return aPromise<T>.awaitexpression which takes in any expression and attempts to call it (error if it's not an awaitable/Promise)Promise<T>as a basic empty compiler type, which for now only contains the most basic parameters and data, as well as allows the compiler to properly recognise whether anawaitis valid.