As the title suggests, I’m looking for repos that showcase GHC’s WASM capabilities that I can clone and play with. I have looked at Glasgow Haskell Compiler / ghc-wasm-meta · GitLab which is a good start, but it’s short on end to end demos.
Particularly I am looking for things which highlight:
- Running the wasm program from within a host program, either in Javascript or Rust
- Compiling pure top-level functions (i.e. something other than a self contained
main :: IO ()
) which is used as FFI in the host program. - Anything which exhibits how
Integer
/Natural
are dealt with in GHC 9+, and how you get around this if you’re using wasm32.
I don’t really care if it’s run in the browser or using e.g. node, either are welcome.
My actual use case (in case it matters) is that I want to be able to execute the same pure function in both Haskell and ultimately inside a rust program or in the browser. The function has type something like [Integer] -> [Integer]
and only depends on base and containers (i.e. nothing eccentric).
thanks!