Skip to content

streams are not implemented in wit-bindgen for C bindings #804

Open

Description

@brendandburns

If you try to generate bindings for 0.3.0 for C it fails:

RUST_BACKTRACE=1 wit-bindgen c --autodrop-borrows yes ./wasi-http/wit-0.3.0-draft -w client
thread 'main' panicked at crates/c/src/lib.rs:780:43:
not implemented
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: wit_bindgen_c::push_ty_name
   4: wit_bindgen_c::gen_type_name
   5: wit_bindgen_c::InterfaceGenerator::define_live_types
   6: <wit_bindgen_c::C as wit_bindgen_core::WorldGenerator>::import_interface
   7: wit_bindgen_core::WorldGenerator::generate
   8: wit_bindgen::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I realize that this is actually a wit-bindgen issue, but I think C bindings should be a blocker for an 0.3.0 release.

Activity

  1. dicej commented on Apr 18, 2024

    @dicej
    Contributor

    Yeah, the only tool that can handle stream and future at this point (AFAIK) is isyswasfa and its temporary forks of wit-bindgen and componentize-py (and those only handle Rust and Python at the moment). It emulates support by transforming the stream and future references in the WIT into resource imports.

    I'm currently working on adding support for async lifts and lowers, along with proper (not just emulated) support for stream and future to wit-bindgen, wasm-tools, and wasmtime, and plan to start opening PRs on those projects in the next few weeks. See https://github.com/dicej/component-async-demo for the progress I've made so far.

    I agree that C binding support will be a blocker, and I plan to take a crack at it once the other foundational pieces are in place. If you or anyone else are interested in contributing to those efforts, I'd be happy to collaborate.

  2. added
    S-inactiveStatus: no discussion in over a year. Records silence during triage; not a proposal to close.
    on Aug 20, 2026
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

    P-httpProposal: wasi-httpS-inactiveStatus: no discussion in over a year. Records silence during triage; not a proposal to close.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions