-
Notifications
You must be signed in to change notification settings - Fork 951
Use WASI instead of CommonWA #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is something we will eventually want, certainly. The switch isn't trivial, though: we will need a bit of compiler support because wasi uses a different WebAssembly namespace and LLVM (wasm-ld?) by default puts unknown functions in the env namespace. |
It seems like it's just a matter of annotating the function with a "wasm-import-module" attribute in the LLVM IR. https://rust.godbolt.org/z/m0PI1z |
Seems like it's mostly a matter of parsing a Line 292 in da85710
and then similar to here Lines 840 to 845 in da85710
use wasmImportModuleAttr := c.ctx.CreateStringAttribute("wasm-import-module", frame.fn.WasmImportModule)
frame.fn.LLVMFn.AddFunctionAttr(wasmImportModuleAttr) |
Yes, something like that will be needed. |
If nobody is working on this, I can maybe give it a try :) |
Sure, feel free to work on it. 👍 |
Code that adds |
The |
@CryZe I wonder what's needed next. |
We are using WASI now, so I think this issue can be closed. Please reopen if I am mistaken. Thanks everyone! |
CommonWA was an initial prototype of what turned into the official WASI specification. It seems like tinygo is still using CommonWA. The runtime should probably be adjusted to use WASI, with maybe an optional switch back to CommonWA, if anyone still wants to keep using that.
The text was updated successfully, but these errors were encountered: