Stream: git-wasmtime

Topic: wasmtime / issue #4423 How to pass a externref to wasm in...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2022 at 14:10):

Zhangyx24 opened issue #4423:

Question

I want to excute the following wasm program :
test.txt
,but how to pass the externref parameter?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2022 at 14:11):

Zhangyx24 edited issue #4423:

Question

I want to excute the following wasm program :
<img width="510" alt="截屏2022-07-09 下午10 11 01" src="https://user-images.githubusercontent.com/28601300/178109442-9fe6214e-14e5-4167-a377-0263e27ebd87.png">

test.txt
,but how to pass the externref parameter?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2022 at 15:52):

bjorn3 commented on issue #4423:

I don't think you can. What would you put in the externref anyway? It is an opaque reference to a value of any type in the embedder.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2022 at 02:19):

Zhangyx24 commented on issue #4423:

Do you mean that it can only be used in the host high-level language api ?
Could you please give me a simple example?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2022 at 07:10):

bjorn3 commented on issue #4423:

I think so. Here is an example of storing a string in an ExternRef: https://github.com/bytecodealliance/wasmtime/blob/6c70428735d87314a7568542939e1e74f79f7871/examples/externref.rs#L22

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2022 at 07:11):

bjorn3 edited a comment on issue #4423:

I think so. Here is an example of storing a string in an ExternRef (see the rest of this file for a full example of how to use it): https://github.com/bytecodealliance/wasmtime/blob/6c70428735d87314a7568542939e1e74f79f7871/examples/externref.rs#L22

view this post on Zulip Wasmtime GitHub notifications bot (Jul 11 2022 at 14:14):

alexcrichton commented on issue #4423:

Yes there's no way right now to invoke a wasm function that takes an externref from the command line. That would need to be done using the embedding API linked above.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 11 2022 at 14:14):

alexcrichton closed issue #4423:

Question

I want to excute the following wasm program :
<img width="510" alt="截屏2022-07-09 下午10 11 01" src="https://user-images.githubusercontent.com/28601300/178109442-9fe6214e-14e5-4167-a377-0263e27ebd87.png">

test.txt
,but how to pass the externref parameter?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 12 2022 at 08:55):

Zhangyx24 commented on issue #4423:

Thanks a lot !


Last updated: Nov 22 2024 at 17:03 UTC