Stream: wasm

Topic: WebAssembly.Function struct/array type parameters/results


view this post on Zulip Mariano Guerra (Jul 21 2024 at 19:09):

I'm playing with wasm-gc function references and WebAssembly.Function and I'm able to define a js function and pass it as argument to a wasm function that does a call_ref to it but if I want to pass struct/array refs to it I have to define them as anyref and cast them in wasm, is there a way to define a WebAssembly.Function in js with ref types that are more specific than anyref? (refer to structs/array types defined in the wasm module)

view this post on Zulip Mariano Guerra (Aug 17 2024 at 09:38):

here's the code I wrote:

here's how I call it:

https://github.com/marianoguerra/mclulang/blob/7bf8e205afd72c13ca49259a4908f05d24b07f38/wat/fatt.test.js#L267

here's an explanation of the code: https://marianoguerra.org/posts/bootstrap-post-collapse-oop-technology-with-wasm-gc-part-2/

McLulang: The message is the language. Contribute to marianoguerra/mclulang development by creating an account on GitHub.
McLulang: The message is the language. Contribute to marianoguerra/mclulang development by creating an account on GitHub.
McLulang: The message is the language. Contribute to marianoguerra/mclulang development by creating an account on GitHub.

Last updated: Dec 23 2024 at 13:07 UTC