A proof of concept for haskell on truffle, seeing if I can get better performance than ghc
So far, I can't
With that said, this is probably the best (easiest & fastest) way to get haskell on the jvm (if you care about that)
Use https://github.com/acertain/ghc-whole-program-compiler-project:
- compile normally using ghc-wpc (pinned in that repo, but you might want to try a newer version, as you'll need to build ghc yourself otherwise)
- use
ghc-whole-program-compiler-project/external-stg/app/mktrufflestg.hs
on theMain.o_ghc_stgapp
file ./gradlew run --args="path/to/Main.trufflestg/stg/Main args"
or./gradlew installDist
thenbuild/install/trufflestg/bin/trufflestg path/to/Main.trufflestg/stg/Main args
You likely need to use graalvm 11 as your jvm
gradle run
will run the launcher out of the local directory without installing anything.
gradle distZip
orgradle distTar
will create an archive containing the required runtime jars. However, you'll need to haveJAVA_HOME
set to point to your Graal installation, if you want to use thetrufflestg
script from the installation folder.
This is not a complete stg implementation:
- Most primops are missing
- FFI doesn't work, and only a few C functions are polyfilled
- There's probably bugs
In the unlikely event that anybody cares about this project that also uses Windows XP, one of the dependencies used for color pretty printing depends on the "Microsoft Visual C++ 2008 SP1 Redistributable" when invoked on Windows.
You can get a free copy from MS at:
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=5582
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as per LICENSE.txt, without any additional terms or conditions.
Contributions and bug reports are welcome!
Please feel free to contact me through github or on the ##coda or #haskell IRC channels on irc.freenode.net.
-acertain