WaEmbedderEx
Idiomatic Elixir wrapper over wa_embedder,
the Erlang WebAssembly→BEAM compiler core. WaEmbedder.compile/1..4 parses a
.wasm binary, translates it to Erlang abstract format, compiles and loads it
as a native BEAM module, and raises %WaEmbedder.ImportError{} on
unsatisfiable imports.
This package is a thin shim; the compiler pipeline lives in the pure-Erlang
:wa_embedder core (usable directly from Erlang without Elixir).
Installation
def deps do
[{:wa_embedder_ex, "~> 0.1"}]
end
Usage
{:module, mod} = WaEmbedder.compile("path/to/module.wasm")
mod.some_exported_fun(arg)
For modules with imports, pass an imports map:
WaEmbedder.compile("mod.wasm", %{"env" => %{"add" => {MyMod, :add}}}, [])
License
Unlicense (public domain). See UNLICENSE.