Stream: git-wasmtime

Topic: wasmtime / PR #8070 Remove type information from dynamic ...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:16):

alexcrichton requested dicej for a review on PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:16):

alexcrichton requested fitzgen for a review on PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:16):

alexcrichton requested wasmtime-core-reviewers for a review on PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:16):

alexcrichton opened PR #8070 from alexcrichton:simpler-component-func-wrap to bytecodealliance:main:

This commit removes the &Component argument from the component::Linker::func_new API. This is inspired by #8062 where Val holds less type information as well in addition to the realization that type-checking happens at runtime rather than instantiation time.

This argument was originally added to mirror
wasmtime::Linker::func_new which takes a type argument of the core wasm function that's being defined. Unlike core wasm, though, component functions already have to carry along their type information as part of function calls to handle resources correctly. This means that when a host function is invoked the type is already known of all the parameters and results. Additionally values are already required to be type-checked going back into wasm, so there's less of a need to perform an additional type-check up front.

The main consequence of this commit is that it's a bit more difficult for embeddings to know what the expected types of results are. No type information is provided when a host function is defined, not even function arity. This means that when the host function is invoked it may not know how many results are expected to be produced and of what type. Typically though a bindings generator is used somewhere along the way so that's expected to alleviate this issue.

Finally my hope is to enhance this "dynamic" API in the future with a bit more information so the type information is more readily accessible at runtime. For now though hosts will have to "simply know what to do".

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:34):

dicej submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:34):

dicej submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:34):

dicej created PR review comment:

    /// compared to [`Linker::func_wrap`]. With [`Linker::func_wrap`] a

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:42):

alexcrichton updated PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:42):

alexcrichton has enabled auto merge for PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 20:44):

github-actions[bot] commented on PR #8070:

Subscribe to Label Action

cc @fitzgen, @peterhuene

<details>
This issue or pull request has been labeled: "fuzzing", "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 21:49):

alexcrichton updated PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 21:49):

alexcrichton has enabled auto merge for PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 22:30):

alexcrichton updated PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 22:30):

alexcrichton requested wasmtime-default-reviewers for a review on PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 22:30):

alexcrichton has enabled auto merge for PR #8070.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 23:13):

alexcrichton merged PR #8070.


Last updated: Nov 22 2024 at 16:03 UTC