Skip to content

v0.5.0 - Async functions & methods, Return arguments

Compare
Choose a tag to compare
@aldrinmathew aldrinmathew released this 24 Oct 18:43
26d09ba
  • Async functions & member functions have landed in the language. Under the hood, this uses the C pthread library. Await is implemented as a conditional loop that uses volatile loads to check the state of the future
  • async, await and future keywords have been added. The future datatype has also landed and despite being one type, this along with the async-await semantics took a lot of effort to finish
  • Return arguments have landed. This system is currently used by futures to manage the state and the value of the future.
  • Return argument is the last argument of a function, that is a reference to stack memory, which can be used to set the return value of the function. The return value of the function will be changed to void under the hood. Currently this is implicitly used in async functions.
  • Give sentence inside async functions sets the future value via the return argument and calls pthread_exit