Skip to content

docs: wasm-bindgen supports wasm32-unknown-emscripten #62

Description

@polarathene

Likewise, if you're using wasm32-unknown-unknown instead of emscripten (as wasm-bindgen is only compatible with the former), you have no libc

This comment (from initial commit of the project in Nov 2020) may need to be revised as wasm-bindgen does now have support for the emscripten target (since March 2026).

I am not familiar with information conveyed here regarding emscripten + wasm-bindgen support for printf-compat, but assume that you'd be providing a printf symbol from a rust method backed by printf-compat for C/C++ to have access to at link time, and thus wasm-bindgen would be providing that for the emscripten target? 🤷‍♂️

The comment is present in the following two locations:

printf-compat/README.md

Lines 22 to 25 in a6f6aad

- Likewise, if you're using `wasm32-unknown-unknown` instead of emscripten
(as wasm-bindgen is only compatible with the former), you have no libc. If
you want to interface with a C library, you'll have to do it all yourself.
With this crate, that turns into 5 lines instead of hundreds for `printf`.

printf-compat/src/lib.rs

Lines 17 to 20 in a6f6aad

//! - Likewise, if you're using `wasm32-unknown-unknown` instead of emscripten
//! (as wasm-bindgen is only compatible with the former), you have no libc. If
//! you want to interface with a C library, you'll have to do it all yourself.
//! With this crate, that turns into 5 lines instead of hundreds for `printf`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions