What's the current status of WASM/WASI support?

Sebastiaan Koppe mail at skoppe.eu
Sat Nov 4 10:16:10 UTC 2023


On Friday, 3 November 2023 at 23:43:59 UTC, Adam D Ruppe wrote:
> On Friday, 3 November 2023 at 23:36:45 UTC, Sebastiaan Koppe 
> wrote:
>> The trouble is that the GC is unable to scan the wasm stack 
>> (let alone the registers) so you have to spill pointers to the 
>> shadow stack. I know its possible, but never managed to find 
>> time to do it.
>
> An even better way is to defer the scan until you return to the 
> javascript event loop, since then you guarantee the wasm stack 
> is empty.
>
> I've long suspected that would work but never implemented it, 
> and read a thing just earlier today confirming it would work 
> (but now webasm has a new gc thing that works differently 
> google is trying to push: https://v8.dev/blog/wasm-gc-porting )

It will work as long as there is a JS loop to return to where you 
can inject a call to collect. That is not always the case though. 
There are plenty of wasm runtimes where you have no such control.

The wasm gc is interesting. I have been following it since it's 
inception and it's great to see it arriving. Haven't had time to 
play with it, but I expect it to get traction.


More information about the Digitalmars-d mailing list