cargo-wasi VS wasm-bindgen

Compare cargo-wasi vs wasm-bindgen and see what are their differences.

cargo-wasi

A lightweight Cargo subcommand to build Rust code for the `wasm32-wasi` target (by bytecodealliance)

wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript (by rustwasm)
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
cargo-wasi wasm-bindgen
2 50
446 8,122
0.0% 1.3%
3.3 9.5
over 1 year ago about 2 months ago
Rust Rust
Apache License 2.0 Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

cargo-wasi

Posts with mentions or reviews of cargo-wasi. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-07-18.
  • Rust + WASM + Typescript [+ React]
    7 projects | /r/rust | 18 Jul 2023
    There are many options, but what worked best for me is compiling with cargo-wasi and loading the resulting Wasm file with browser_wasi_shim. Using wasm32-wasi instead of wasm32-unknown-unknown requires a bit more work (the communication with JS has to be set up manually), but gives the flexibility of having just a Wasm file that can be dropped in and loaded dynamically. (There's wit-bindgen for generating wrapping code according to an interface definition but I didn't have much success with it.)
  • #![no_std] with WASI is more complicated than I thought it would be
    7 projects | dev.to | 2 Jun 2021
    I use cargo-wasi to build it:

wasm-bindgen

Posts with mentions or reviews of wasm-bindgen. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-10-15.
  • Sqlite3 WebAssembly
    20 projects | news.ycombinator.com | 15 Oct 2024
    > I couldn't figure out a way to to get emscripten wasm code to play nice with wasm32-unknown-unknown

    There is good news there, some people plan to work on making Emscripten and Rust work well in Wasm:

    https://github.com/rustwasm/wasm-bindgen/pull/4014#issuecomm...

  • Is the Web Browser the Most Important Platform for App Development?
    6 projects | dev.to | 3 Oct 2024
    That said, WebAssembly’s ecosystem is still fragmented. Tools like Emscripten (C/C++), wasm-bindgen (Rust), and JSGo (Go) serve different languages, but this complicates the standardization of interactions with web APIs, limiting broader WASM integration with web development.
  • Show HN: Free e-book about WebGPU Programming
    2 projects | news.ycombinator.com | 5 Aug 2024
    > Here's an example of Bevy WebGL vs Bevy WebGPU

    I think a better comparison would be more representative of a real game scene, because modern graphics APIs is meant to optimize typical rendering loops and might even add more overhead to trivial test cases like bunnymark.

    That said though, they're already comparable which seems great considering how little performance optimization WebGPU has received relative to WebGL (at the browser level). There are also some performance optimizations at the wasm binding level that might be noticeable for trivial benchmarks that haven't made it into Bevy yet, e.g., https://github.com/rustwasm/wasm-bindgen/issues/3468 (this applies much more to WebGPU than WebGL).

    > They're 10k triangles and they're not overlapping... There are no textures per se. No passes except the main one, with a 1080p render texture. No microtriangles. And I bet the shader is less than 0.25 ALU.

    I don't know your exact test case so I can't say for sure, but if there are writes happening per draw call or something then you might have problems like this. Either way your graphics driver should be receiving roughly the same commands as you would when you use Vulkan or DX12 natively or WebGL, so there might be something else going on if the performance is a lot worse than you'd expect.

    There is some extra API call (draw, upload, pipeline switch, etc.) overhead because your browser execute graphics commands in a separate rendering process, so this might have a noticeable performance effect for large draw call counts. Batching would help a lot with that whether you're using WebGL or WebGPU.

  • Facilitating high-level interactions between WASM modules and JavaScript
    1 project | news.ycombinator.com | 4 Jul 2024
  • Dealing with Unicode string, done right and better.
    8 projects | dev.to | 15 Jun 2024
    I already knew that there was a good quality library unicode-segmentation in Rust, and Rust has a great WebAssembly toolchain called wasm-bindgen.
  • Implement a Simple Calculator Android App by Reusing Logics in Rust via JavaScript-WASM Interfacing
    3 projects | dev.to | 14 May 2024
    The binding of Rust (WASM) and JavaScript is done with the help of wasm-bindgen and wasm-pack -- https://github.com/rustwasm/wasm-bindgen/tree/main/examples/without-a-bundler
  • If the native speed DOM/Web API for Rust becomes a reality, would you be willing to build your web apps with Rust and HTML/CSS?
    3 projects | /r/rust | 5 Dec 2023
    Another strange issue could be seen in the strict class heritage organized definition of the DOM, which can not be handled very well by rust because of a still unsolved bindgen issue (#210).
  • Rust + WASM + Typescript [+ React]
    7 projects | /r/rust | 18 Jul 2023
    For a much simpler but less flexible approach there's wasm-pack for creating JS packages from Rust, and wasm-bindgen for easy interop. Both have very good documentation.
  • We Just Released our Rust WebTransport Teleconferencing System - Here are Some Lessons Learned
    10 projects | /r/rust | 10 Jul 2023
    We encountered quite a few hurdles on our journey. For one, we had to build our own yew-webtransport and yew-websocket integration from scratch by adding WebTransport definitions to wasm-bindgen (pull request link). We also had to add WebTransport support to the h3 crate (pull request link). co-created by @ten3roberts
  • Looking to create a backend service for a website in Rust and I’m wondering on how to best do it
    2 projects | /r/rust | 28 Jun 2023
    Go with your WebAssembly module idea. Since it sounds like your chess engine does not draw a UI, it shouldn't be too difficult. wasm-bindgen will be your best friend.

What are some alternatives?

When comparing cargo-wasi and wasm-bindgen you can also consider the following projects:

wee_alloc - The Wasm-Enabled, Elfin Allocator

wasmer - 🚀 Fast, secure, lightweight containers based on WebAssembly

compiler-builtins - Porting `compiler-rt` intrinsics to Rust

wasmtime - A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

wasi-rs - Experimental WASI API bindings for Rust

wasm-pack - 📦✨ your favorite rust -> wasm workflow tool!

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured

Did you know that Rust is
the 5th most popular programming language
based on number of references?