-
Notifications
You must be signed in to change notification settings - Fork 82
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
Is it possible to dynamically link several wasm modules in Go host? #166
Comments
Apologies I misunderstood your question in bytecodealliance/wasmtime#5415 as I thought it was related to static/dynamic linking of Wasmtime itself. I think what you're looking for is here: Lines 237 to 306 in 4b3a40c
|
Yes, thank you. This is exactly what I was asking for. Can I please ask you a related question? Well, in wasm we have basic entities which are functions, global variables or memories. And we can import/export (i.e. dynamically link) them between wasm modules. But in the real-life project we may have a library written either in Rust or TinyGo and it has not just functions, but OOP entities like classes (or Go structs with methods, etc). Is it possible at all to accomplish the same thing in such a case. I mean to have a library in Rust/TinyGo with classes and another main module in Rust/TinyGo with code that uses those classes. Both the library and main module are compiled separately to wasm and dynamically linked together at runtime in the same manner as shown in the example above? |
While technically possible it's not easily done. You'd need to have some form of wrapping/compat in both languages to get everything hooked up correctly. That being said the component model will enable more seamless integration of a scenario that you're describing. |
Thank you for your help! |
Wait just a minute... What if, in my case both the library and the main modules will be implemented in the same language (both in TinyGo, or both in Rust) - does this change the situation to any better? |
Unfortunately, no, not that I'm aware of. |
Hello,
Is it possible to use dynamic linking in Go host, similar to this example https://docs.wasmtime.dev/examples-rust-linking.html (which demonstrates Rust host)?
The text was updated successfully, but these errors were encountered: