Skip to content

acertain/trufflestg

Repository files navigation

trufflestg

Travis Continuous Integration Status Most used language

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)

Running

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 the Main.o_ghc_stgapp file
  • ./gradlew run --args="path/to/Main.trufflestg/stg/Main args" or ./gradlew installDist then build/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.

Installing

  • gradle distZip or gradle distTar will create an archive containing the required runtime jars. However, you'll need to have JAVA_HOME set to point to your Graal installation, if you want to use the trufflestg script from the installation folder.

Incomplete

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

Windows XP

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

Contribution

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.

Contact Information

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

About

wip, haskell stg on truffle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages