News for hackers. Stuff that matters.
Re:WebAssembly: A promising technology that is quietly being... by aixpert on Wednesday May 22, 2024 @11:41PM (#40450227)
Wait they promised to not adopt the cancerous function coloring approach in wasm. Please tell me they didn't follow the dark path of JS
Re:WebAssembly: A promising technology that is quietly being... by leucippe on Friday May 24, 2024 @02:37AM (#40463478)
The plan is to support async without function colouring.

I recommend this talk by Luke Wagner on async plans in WASI 0.3 (https://youtu.be/y3x4-nQeXxc) for background on how it will work.

To summarise, from an API perspective, the caller and callee won't know if the other is async or not. When calling async from non-async, an event loop is inserted at link-time and it blocks.* When calling non-async from async, the callee will get suspended if it tries to do blocking IO. That still leaves the problem of long-running compute without IO in a non-async context, but at least you're not wasting CPU time in that scenario.

* If the host runtime already has an event loop, I assume the callee will get added to that.