Skip to content

TristanCacqueray/tiny-game-haskell-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny-game-haskell-wasm

A WIP proof of concept to run tiny-game-hs in the browser.

Usage

# 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

Limitations

  • stdin does not work
  • wasi.js poll_oneoff needs to be patched to replace throw "async io not supported" with return 1.