/binaryen

Haskell bindings to the binaryen project

Primary LanguageWebAssemblyBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

binaryen

A fork of binaryen, adding Haskell raw bindings. This package is a part of the asterius Haskell-to-WebAssembly compiler project, yet it may also be useful to other WebAssembly-related Haskell projects as well.

Building and using

The custom Setup.hs script calls cmake and make to build libbinaryen.a and the binaryen executables, use the MAKEFLAGS environment variable to pass additional flags to make (e.g. -jN). A simple stack build should work fine; for cabal users, hpack needs to be run on package.yaml to generate binaryen.cabal.

Bindings.Binaryen.Raw contains 1-to-1 raw bindings to the binaryen C API. Executables which use this module will automatically link against libstdc++ and libbinaryen.

It's also possible to run the binaryen executables like wasm-opt; use Paths_binaryen.getBinDir to get the executable location.