Logging thoughts and approaches on getting (parts of) the Haskell ethereum client running in the browser.
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
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 node-levelup with the locket library as a backend for leveldb-haskell. Alternatives are level.js and MemDOWN UNTESTED
-
- 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
-
- Compile C-code with emscripten