Elixir WASM
Build and compile WASM IR for Elixir
Defines an IR for Web Assembly in Elixir, and functions for parsing and compiling .wasm binaries from it. The WASM IR is inspired from Elixir's quoted expressions and Erlang's absform so it is familiar 😄
Note: This is untested and very unstable. Not production ready
- Binary Format
- [Validation](http://webassembly.github.io/spec/validation/index.html
- Unit tests
Install
Add it to your deps inside mix.exs:
{:wasm, "~> 0.1.0"}
Then run
mix deps.get
Usage
WASM.compile(node)
Compiles an IR node tree into a binary.
binary = WASM.compile({:block, {:type, :block, :i32}, [
{:div_s, :i32},
{:eq, :i32}
]})