Stream: wasmtime

Topic: support for externref


view this post on Zulip Karl Werner (Oct 10 2022 at 15:51):

Hello,
Can somebody tell me if the externref.wat example (https://github.com/bytecodealliance/wasmtime/blob/main/examples/externref.wat) was written by hand or was it compiled from a different language to wat ?
Does anybody know if there is already support for "externref" reference types in a language which can be compiled to wat?

My goal is to use externref reference types in a wat-module as an input/output. But this wat-module should be written in a different language and then be compiled to wat.
I am currently trying to write a module in C and then compile it to wat with emscripten. But I have problems to initialize externref in the C code and then compile it properly to wat .

I appreciate any help.

Thank you very much.
Karl

A fast and secure runtime for WebAssembly. Contribute to bytecodealliance/wasmtime development by creating an account on GitHub.

view this post on Zulip Alex Crichton (Oct 10 2022 at 16:13):

That *.wat file is written by hand, and while I think a number of languages might have experimental support for externref I at least not personally aware of a language with first-class support

view this post on Zulip Karl Werner (Oct 12 2022 at 09:16):

Thank you very much for your answer! Do you know where to find documentation for this?

view this post on Zulip Lann Martin (Oct 12 2022 at 12:50):

Documentation for externref itself?

view this post on Zulip Karl Werner (Oct 13 2022 at 07:41):

My goal is to call a wasm-module with the externref type as input/output from a host code with wasmtime. Therefore, the wasm-module must support externref types. So far, I have written the wasm-modules by hand directly in wat similar to the example above. But now I would like to compile them from a different language. So, I can write an application in a different language and then compile them to wasm and call them from the host code. For example, compiling C code to a standalone wasm-module using emscripten.

Do you know where to find documentation for compiling a program to a wasm-module with externref support?
(It doesn't have to be for compiling C to wasm with emscripten, it can be for any other language/compiler)


Last updated: Dec 23 2024 at 13:07 UTC