i'm working on porting our application to wasi, and i'm interested in what the plans are for two interfaces that would be useful for us:
as discussed earlier in #general, i wouldn't be so dependent on wasi for these if it wasn't for the fact that i can't have a wasi-compatible application with optional non-wasi imports.
re: dlopen, it isn't at all straightforward to implement, but @Joel Dice is doing it anyway :smile:
There is a sockets proposal in wasi
https://github.com/WebAssembly/wasi-sockets/
Lann Martin said:
re: dlopen, it isn't at all straightforward to implement, but Joel Dice is doing it anyway :smile:
thanks! any pointers?
See https://github.com/dicej/component-linking-demo (when GitHub is back up) for an example of using dlopen
with WASI. It currently requires patched versions of wasi_sdk
and wasm-tools
, which I'm in the process of getting upstreamed.
Kyle Brown said:
There is a sockets proposal in wasi
https://github.com/WebAssembly/wasi-sockets/
what's the status of that in layman's terms (i.e. it's making its way into preview2, etc.)? sorry to say the wasi spec process appears a little opaque from an outsider's perspective
Joel Dice said:
See https://github.com/dicej/component-linking-demo (when GitHub is back up) for an example of using
dlopen
with WASI. It currently requires patched versions ofwasi_sdk
andwasm-tools
, which I'm in the process of getting upstreamed.
that seems to rely on the runtime supplying a static set of libraries/symbols at startup?
Ya, I like to call it "not-quite-dynamic" linking because it hooks into dynamic linking/loading APIs but does require you to have them all at build time.
I'm not sure the exact status of the proposal. @Badeend who is its champion may be able to help summarize.
that seems to rely on the runtime supplying a static set of libraries/symbols at startup?
Yes, that's correct. I've been calling it pseudo-dynamic linking. Truly dynamic linking is out of scope for the time being. You could probably rig something up on your own, e.g. via trampoline functions using Wasmtime's embedding API.
I'm not sure what a standardized form of true dynamic linking would look like; it's not something I've thought about much, yet.
i guess if done unix-style, there effectively be all the complexity of a dynamic linker including recursive dependencies
Last updated: Nov 22 2024 at 16:03 UTC