Limited port of libffi
to pure wasm32
.
Note that this repo's issue tracker is closed; please report issues in
ghc with the wasm
tag instead.
- Function argument count is capped to
4
- For each function type, closure count is capped to
16
. Both constants can be tuned, and exceptions can be made for specific function types - Closure API is modified, closure alloc/prep is done in a single call
- No support for structures or variadic functions yet
This is a Haskell cabal project, simply run the libffi-wasm
executable. It'll generate additional C sources in cbits
. Then
include stuff in cbits
for your own usage.
See this blog post for details.