-
Notifications
You must be signed in to change notification settings - Fork 73
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
Interoperability of array types with host #146
Comments
This is not going to work at all without support from some glue code. There is not enough information in the signature. Apart from anything else, the $bytes parameter is (as far as wasm is concerned) an index not an address. |
How should this glue code look? Both already the simplest array types.
$bytes is a type. If I call the function then I pass a real reference. And a reference is a address. I does not understand what you means. |
@rossberg's proposal has an accompanying proposal on the JS side which lays out how this reflection would work. See this explainer by @lukewagner for how the two interact, and my Typed Objects explainer. Note that both of these are somewhat outdated by now, but AFAICT the fundamentals haven't changed enough to make these explainers lose all meaning :) |
There's slightly more discussion on arrays in #151, so I'll close this similar issue. |
How would the interoperability of array types with the host (JavaScript) work? For example I have define an i8 array and an import like:
If I call this function, can I expect a Uint8Array in JavaScript and a byte pointer in another host?
If so, shouldn't we then predefine these primitive arrays as own type and add the type mapping to the proposal?
Or is this only possible via interface types? What will I receive without such interface type definition?
The text was updated successfully, but these errors were encountered: