sehz opened PR #7778 from sehz:custom_wasi_link
to bytecodealliance:main
:
Allow passing of closure to wasi command linking. Current
add_to_linker
is re-implemented more general API
sehz requested alexcrichton for a review on PR #7778.
sehz requested wasmtime-core-reviewers for a review on PR #7778.
sehz edited PR #7778:
Allow passing of closure to wasi command linking. Current
add_to_linker
is re-implemented more general API. Without this, it's hard to create reusable wasi context store
alexcrichton commented on PR #7778:
Thanks for the PR, but this is something we were ideally hoping to avoid with the
WasiView
trait design. Would it be possible to implementWasiView
for your typeT
within theStore<T>
?
Problem is that
T
is becoming very complex. Ideally Store should be composable. Key problem is that store is tied to linker which makes difficult separate host implementation
sehz edited a comment on PR #7778:
Issue is that
T
is becoming very complex. Ideally Store should be composable. Key problem is that store is tied to linker which makes difficult separate host implementation
alexcrichton commented on PR #7778:
I understand that
T
can be complex, and I also understand that writing a closure is shorter than writing a trait impl, but I'm not sure why the complexity would make trait impls more difficult (as opposed to a simpleT
). The fact that the store and linker are tied together is indeed a bit limiting, but with trait bounds it should be possible to design roughly the sme APIs.Is there anything preventing the trait impls on
T
in your case?
alexcrichton commented on PR #7778:
We chattec a bit more tonight about this and I think it's a reasonable enough feature to add given it's pretty small and solves a concrete use case. If you're ok fixing the failing test on CI (I think there's a new trait bound needed) I can r+
Thanks. Will fix CI
Last updated: Nov 22 2024 at 17:03 UTC