Skip to content
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

some example show calling wasm written with go office #74

Closed
wuhuizuo opened this issue Dec 13, 2021 · 3 comments
Closed

some example show calling wasm written with go office #74

wuhuizuo opened this issue Dec 13, 2021 · 3 comments

Comments

@wuhuizuo
Copy link

  1. wasm source example with go office.
  2. tests call go office wasm binnay with wazero.
@codefromthecrypt
Copy link
Contributor

Hi, and sorry we missed this. Is this the example you are interested in? https://github.com/wuhuizuo/go-wasm-go

It seems you want to have an example where wazero loads a wasm binary that calls a go function. Correct?

This example calls a host function: https://github.com/tetratelabs/wazero/blob/main/examples/host_func_test.go#L27

Another more simpler is this, but note the text format is incomplete, so changing the source will not likely work, yet. See tetratelabs/wabin#1 for progress: https://github.com/tetratelabs/wazero/blob/main/examples/simple_test.go

@wuhuizuo
Copy link
Author

Hi, and sorry we missed this. Is this the example you are interested in? https://github.com/wuhuizuo/go-wasm-go

It seems you want to have an example where wazero loads a wasm binary that calls a go function. Correct?

This example calls a host function: https://github.com/tetratelabs/wazero/blob/main/examples/host_func_test.go#L27

Another more simpler is this, but note the text format is incomplete, so changing the source will not likely work, yet. See tetratelabs/wabin#1 for progress: https://github.com/tetratelabs/wazero/blob/main/examples/simple_test.go

I mean wazero load WASM file which was compiled with office golang compile, and call the functions.

@codefromthecrypt
Copy link
Contributor

maybe you can look at this which builds on @pkedy's work to use wazero in wapc-go. It is a fairly complete usage pattern including memory wapc/wapc-go#15

I'm closing the issue because I hope this answered the question!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants