Using WASM for a plugin system in Rust? (generate code at runtime and then hot reloading it as a library)

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 API for authentication & user identity.
  • Onboard AI - ChatGPT with full context of any GitHub repo.
  • wit-bindgen

    A language binding generator for WebAssembly interface types

    Yes, wasm_bindgen is js only. At least for now, in future I would also expect it to migrate to component model. There is also cargo-component which is a way to create modules compatible with component model. You define your module interface in WIT and your dependencies on other wasm modules in the similar way you would define crate dependencies. Alternately there is wit-bindgen that is a codegen tool for multiple languages that also accepts WIT as input.

  • component-model

    Repository for design and specification of the Component Model

    It may be not the answer you want depending on your time restrictions but I also tried doing the same and currently just waiting for wasm component model proposal to be finished.

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

  • cargo-component

    A Cargo subcommand for creating WebAssembly components based on the component model proposal.

    Yes, wasm_bindgen is js only. At least for now, in future I would also expect it to migrate to component model. There is also cargo-component which is a way to create modules compatible with component model. You define your module interface in WIT and your dependencies on other wasm modules in the similar way you would define crate dependencies. Alternately there is wit-bindgen that is a codegen tool for multiple languages that also accepts WIT as input.

  • wasmtime

    A fast and secure runtime for WebAssembly

    The only runtime that at least partially implements component model is wasmtime. But, as everything with component model, it is still WIP.

  • fp-bindgen

    Bindings generator for full-stack WASM plugins

    Yep, you're right. For this, there are a few options. The ones most relevant to you are fp-bindgen, which targets Wasmer, and wit-bindgen, which targets wasmtime.

  • WorkOS

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

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