raineorshine
3/31/2015 - 6:36 AM

Ethereum-haskell-client in the browser roadmap

Ethereum-haskell-client in the browser roadmap

Logging thoughts and approaches on getting (parts of) the Haskell ethereum client running in the browser.

Backends

There are a number of different alternatives. In order of appearance, I estimate the following to languages to need the least amount of porting.

  • GHCJS supports full GHC
  • Haste is full Haskell but with different libraries
  • Fay is a proper subset of Haskell
  • Elm is a Haskell-like language
  • PureScript is inspired by Haskell

Stages

GHCJS

It can be a bit tricky to set up, it will only get really easy once GHC 7.10 is released on the Haskell Platform. For now I use the GHCJS Docker file, build it there in a sandbox and copy the files back into the host (I can't get GHCJS to build without cabal dependency issues).

  • ethereum-rlp is working as-is

  • ethereum-leveldb will need a workaround for the dependency of leveldb-haskell, and hence leveldb. It seems that ethereum-leveldb only uses basic functionality of leveldb-haskell (ie open/close/get/put). Possibilities are:

    • use locket directly under ethereum-leveldb. UNTESTED
    • use node-levelup with either
  • There is also low-level C code for fast nonceNonceFinder:

    • Re-write this in Haskell (already existing?)
    • Re-write in JavaScript