-
Notifications
You must be signed in to change notification settings - Fork 687
[RFC] Support more WASI proposals(beyond wasi-libc p2) #3685
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
Comments
do you mean WASI-p2?
wasi_snapshost_preview1 will eventually be replaced by wasip2 things, right? |
IIUC, if using
I don't know. I am hoping somebody might be able to answer that. |
my question was about your sentence "by integrating advanced features of the WASI-p1". |
Yes. Advanced features of the WASI-p2. |
Thanks for kicking off the discussion. From our perspective, at least for time being, we don't need a full P2 support (i.e. WASI + Component Model) and just having "T2" would be sufficient. From what I understand, both T2 and preview1 can co-exist as they're in completely different namespaces, so one can choose to build WAMR with both T2 and preview1 enabled, and core module compiled to either target will work (ofc mixing T2 and preview1 calls within the same module might be dangerous, so users should be careful with that). And I think that might be a reasonable plan to first focus on just P2 imports, and only after that provide a full component model support (if ever needed). Regarding potential deprecation of preview1 in WAMR - at that stage we'd really need to keep it around; however, we'll invest in the adapter https://github.com/loganek/wasi-snapshot-preview2-to-preview1-adapter/ and as soon as it's stable, my team will no longer need preview1 support in WAMR - if there are no other teams relying on that, perhaps it's something we might choose to deprecate over time. |
Yes, that's correct. In my understanding, there's a stronger demand for new features in WASI compared to the need for a component model. Therefore, priority should be given to handling p2 imports. |
in case it was not clear, i meant about the use of the adapter in wasi-libc wasip2 build. |
I'm not entirely certain if this is an actual issue or just a misunderstanding on my part. There are roughly 25+ WASI proposals, yet only a handful are supported by wasi-libc, even in P2. This means that a developer cannot utilize the capabilities of the new proposals without directly using binders (often created by wit-bindgen) or libraries built on top of these binders. Compared to using established libraries, working with raw binders demands a deeper understanding of the intricacies involved in type conversion, memory management, and communication between the host and WebAssembly. This can be confusing and challenging. Despite the fact that more than 75% of the new proposals focus on networking and cloud applications, the trends and practices established now could influence future proposals. When we look at the Rust/WebAssembly ecosystem, programmers have a wealth of libraries at their disposal, with crates available for almost all WASI proposals on crates.io. On the other hand, C/WebAssembly programmers face a scarcity of libraries, making it difficult to find C libraries related to WASI proposals. The goal of raising this issue is to enhance support for WASI capabilities. Initially, I believed that all that was needed was to back wasi-libc (P2). However, it now appears that there is also a need to develop C libraries related to WASI proposals that based on binders. |
Any updates on the support for WASI P2 in WAMR ? |
The goal of raising this issue is to enhance support for more WASI capabilities.
wasm32-wasi-p2-module, or wasm32-wasi-t2, is a new concept highlighted in a slide in Wasm CG June 2024. The initial idea can be found in a discussion.
P2-module is expected to enhance core modules by integrating advanced features of the WASI-p2, such as networking and encryption capabilities, which are anticipated to be highly appealing to users.
While there hasn't been an official release yet, developers can create wasm-wasi-p2-modules using the latest versions of wasi-sdk(22 and 23). This is done by compiling with the options
--target=wasm32-wasip2 -fuse-ld=lld
. The output has a mixed version of imports,wasi_snapshost_preview1
andwasi:[email protected]
:The imports are same with wasm32-wasi-p2.
When implementing, the original wasi library at core/iwas/libraries/libc-wasi won't be touched. The new stuff will be stored at core/iwasm/libraries/libc-wasi-p2-module. If later, it is found to be able to shared with wasm32-wasi-p2, might be renamed to libc-wasi-p2.
The text was updated successfully, but these errors were encountered: