Haskell WebAssembly for Browser Interaction
funwithfunctions.com·5w·
Discuss: Hacker News
Flag this post

The Goal

I wanted to test out the WASM support that GHC now offers in the very recent versions. Since this blog has very little JS itself, I thought it would serve as a good testbed by building a little theme toggle with the following requirements:

  • The logic should be written in Haskell, it can’t just be a value-less shim that just wraps around some JavaScript logic.
  • If possible it would make use of at least one dependency that isn’t part of the standard library, because it would be nice to use helpful libraries and not have to reimplement them badly.

The Setup

From what I found (at the time of writing) this appeared to be the best starting point to work from: ghc-wasm-meta. As it’…

Similar Posts

Loading similar posts...