Skip to content

One way to call and register functions #1997

Open

Description

@ludfjig

Each operation has several entry points with different costs:

  • Host calls: call, and the deprecated call_guest_function_by_name.
  • Guest calls to the host: call_host, and call_host_function, which takes an owned Vec<ParameterValue>.
  • Guest registration: #[guest_function], register_fn, and register_function with a hand-built definition.

Proposal:

  • Remove call_guest_function_by_name.
  • Add guest call_host_dynamic(name, &[ParameterValueRef], ReturnType) for runtime signatures. Deprecate call_host_function.
  • Deprecate register_function and print_output_with_host_print. Switch WIT codegen to register_fn.

Builds on #1987.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/APIRelated to the API or public interfacelifecycle/needs-reviewThe issue has not yet been reviewed.

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions