A WIP proof of concept to run tiny-game-hs in the browser.
# Install toolchain
$ nix develop
# Build wasm module
$ wasm32-wasi-ghc tiny-brot.hs -o dist/tiny-brot.wasm
# Build JS client
$ npm install && npm run bundle
# Copy index
$ cp index.html dist
# Serve browser
$ (cd dist; python3 -m http.server)
# Browse
$ firefox http://localhost:8000
- stdin does not work
- wasi.js
poll_oneoff
needs to be patched to replacethrow "async io not supported"
withreturn 1
.