-
Notifications
You must be signed in to change notification settings - Fork 926
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
tinygo wasm externref support #2702
Comments
I think main issue will be how to represent what should be an externref param unambiguously. Also, per spec they are supposed to be completely opaque from the perspective of the guest. So, if represented by |
Right now we don't support externref. Also I don't see how this is going to help you: TinyGo interface values are different from Go interface values. They cannot be interchangeable. If they were, implementing the missing reflect functions would be trivial. I don't see anything to do here right now. |
@aykevl externref is a way to opaquely pass a value the host has in a way that the wasm compiled by tinygo never uses. It is intentional that it isn't interchangeable in other words. rust doesn't yet support externref either, hence a package like this: https://github.com/slowli/externref The main thing you get with externref is for the host to be able to stash scoped objects either as globals or stack parameters. The example above is a host-defined sender. I've seen other things like host-defined memory as examples (sometimes string literals they don't want to actually wash through wasm). |
Because reflect support issue, such as #2660
I try to import host func into wasm module,my steps:
define go import function:
build with wasi target, but got import func type:
func (param i32 i32 i32)
I import the func with host's golang
encoding/json.Marshal
:but i got incompatible import error:
Are there any milestones to support compiled to externref?
The text was updated successfully, but these errors were encountered: