Rust + WASM + Typescript [+ React]

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • cargo-wasi

    A lightweight Cargo subcommand to build Rust code for the `wasm32-wasi` target

  • 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.)

  • browser_wasi_shim

    A WASI shim for in the browser

  • 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.)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • wit-bindgen

    A language binding generator for WebAssembly interface types

  • 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.)

  • wasm-pack

    📦✨ your favorite rust -> wasm workflow tool!

  • 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.

  • wasm-bindgen

    Facilitating high-level interactions between Wasm modules and JavaScript

  • 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.

  • wee_alloc

    The Wasm-Enabled, Elfin Allocator

  • As a note, you might find some references to use wee_alloc, but it has been unmaintained for some time and shouldn't be used. I'm using the default allocator with the wasm32-wasi target and it works fine, but I don't know if that works with wasm32-unknown-unknown too; if not there's lol_alloc.

  • lol_alloc

    Like wee_alloc, but smaller since I used skinnier letters in the name.

  • As a note, you might find some references to use wee_alloc, but it has been unmaintained for some time and shouldn't be used. I'm using the default allocator with the wasm32-wasi target and it works fine, but I don't know if that works with wasm32-unknown-unknown too; if not there's lol_alloc.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts