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

WASI reactor mode #2735

Open
slinkydeveloper opened this issue Mar 24, 2022 · 1 comment
Open

WASI reactor mode #2735

slinkydeveloper opened this issue Mar 24, 2022 · 1 comment
Labels
wasm WebAssembly

Comments

@slinkydeveloper
Copy link

Hi all,

I've been experimenting with tinygo having some fun prototyping a go wasm application hosted by wasmtime-java. Unfortunately, I hit a bug/missing feature when trying to access the memory: kawamuray/wasmtime-java#21. As described in that issue, tinygo cannot compile in reactor mode, hence preventing wasmtime-java to access its memory. Although this might be recognized as a limitation of the engine (apparently others, at least from the documentation, can switch the usage mode independently from the exports https://wasmedge.org/book/en/dev/go.html#a-simple-function-run), I think it would be nice if tinygo can support the reactor mode.

I tried to prototype the support myself following what was done for clang https://reviews.llvm.org/D62922 and this is roughly what I needed to come up with a correct export:

If you want I can also provide a proper PR, but i need some guidance :)

@codefromthecrypt
Copy link
Contributor

There may be issues after this, but I guess the main question is how to control the //export name (ex based on flags). Is templating supported?

https://github.com/tinygo-org/tinygo/blob/release/src/runtime/runtime_wasm_wasi.go#L16

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

No branches or pull requests

3 participants