Stream: jco

Topic: async functions for host implementations


view this post on Zulip Ramon Klass (Jan 27 2024 at 20:15):

what's the current opinion about async functions? For example, if I define a fetch function in an interface, then on the js host side that would have to be async so it can return the received bytes

I found this https://github.com/bytecodealliance/jco/issues/39 and I hope that's not the final decision, or else how do I achieve an interface function that fetches an url and returns the data it read?

There are certain cases where the host/guest implementation needs to pass an asynchronous function. Can this be supported in the JavaScript codegen even when the WIT definition has its signature as...

view this post on Zulip Ramon Klass (Jan 27 2024 at 20:23):

the atomics solution mentioned in the issue would work for me since I already run my jco transpiled component in a worker, but it's important to note that Atomics.wait() is usually forbidden on the main thread

view this post on Zulip DougAnderson444 | PeerPiper.io (Feb 27 2024 at 17:27):

Ramon Klass said:

the atomics solution mentioned in the issue would work for me since I already run my jco transpiled component in a worker, but it's important to note that Atomics.wait() is usually forbidden on the main thread

@Ramon Klass I'd be curious to take a look at your design here, mind sharing a link to it please?


Last updated: Dec 23 2024 at 12:05 UTC