A Haskell Virtual Machine implemented in RPython.
This project aims to implement Haskell with the RPython translation toolchain from the PyPy project. The goal is to investigate if Haskell can benefit from just-in-time compilation techniques, and to show that PyPy is a suitable platform for purely functional and lazy languages (e.g. Haskell).
Our Haskell virtual machine is named pyhaskell.
pyhaskell currently support a small subset of the Haskell language.
Run the testsuite to better see what is currently supported.
Problems with GHC's external Core support is currently the biggest issue preventing us from completing this project at this time.
TODO: add a more detailed description of what is supported and not.
- Install dependencies listed above
- Add the PyPy repository folder to your PYTHONPATH env variable.
- Add the path to pyhaskell/ folder to your PYTHONPATH env variable.
- Compile core2js program by running make compile
- Run all tests with make testall (optional)
- Translate pyhaskell to C, run either:
- make translate to include the JIT
- make nojit
TODO: add a LICENSE file for the haskell-python project.
Haskell libraries are loaded from the folder 'pyhaskell/builtin', if a library does not exist there, it attempts to load it from 'pyhaskell/ghc_modules'.
We use RPython to implement some Haskell libraries, as this can be beneficial for testing as well as optimizations. The remaining libraries are generated from GHC's source code.
Currently the generated libraries have been removed, as they did not work and were generated from an outdated GHC version. They can be found at <https://bitbucket.org/eventh/ghc_libraries>.