The initial design issue had several suggestions how we might support asynchronous compilation, including a number of suggestions. I think these ideas and alternatives can be summarized as:
- 1: A separate instruction
func.new_async that explicitly requests asynchronous compilation
- 1A: it writes the result into a location (e.g. table index or global) when completed
- 1B: it returns a kind of promise
- 1C: it is integrated with stack-switching (e.g. it accepts a continuation)
- 2: The implementation of
func.new may return a function that blocks until host-compilation is ready
- 3: There is a polling mechanism for asynchronous functions such as
func.ready which queries whether a function is ready for use (i.e. won't block for host compilation)
Let's move further discussion/design of asynchrony to this issue.
@cfallin @kg @yuri91
The initial design issue had several suggestions how we might support asynchronous compilation, including a number of suggestions. I think these ideas and alternatives can be summarized as:
func.new_asyncthat explicitly requests asynchronous compilationfunc.newmay return a function that blocks until host-compilation is readyfunc.readywhich queries whether a function is ready for use (i.e. won't block for host compilation)Let's move further discussion/design of asynchrony to this issue.
@cfallin @kg @yuri91