Will Haskell be supported in the future?
I think Eta is a good solution
I think it would still be nice to have the actual code generated by GHC running on graal. That way it's always up to date with Haskell and would also have the added benefit of interop with every other language on graal. Also GHC has an LLVM backend, so maybe it could integrate with sulong.
Nobody that I know took Haskell as a Truffle language up yet.
I remember long time ago discussing which one of the many GHC intermediate representations one would use as input for the Truffle AST :-). Definitely should get some inspiration from Eta.
I think implementing Haskell 98 with Truffle should be a good theme for someone's bachelor thesis :)
Unfortunately, nobody is interested in haskell 98; implementing Haskell 2010 with Truffle is a whole different thing...
Maybe better implement Haskell Core, and use GHC as frontend? Should be a lot simpler, even than Haskell 98, and would give you full support of all language features that GHC supports ;)
Or maybe even STG? But that might be too low-level. Hard to tell without trying it out. Maybe two bachelor thesis? Now where to get talented students that are interested in Haskell?
Another option that should be possible:
ghc -fllvm -keep-llvm-files;As far as I understand, this way graal will be not able to do all it's magic things, since it does not have full knowledge of source program's AST; on the other hand, LLVM bitcode will be already optimized by GHC's optimizer, so if JIT will be able to optimize it a little bit further, it will be good.
I did play around a bit with this approach (and I'm not the only one, see https://stackoverflow.com/questions/56681468/how-to-run-haskell-on-graalvm).
One thing I tried and didn't work is to just compile a Haskell "Hello, World" to bitcode and run it. See my answer to the stackoverflow question.
A potential problem with running that kind of languages on top of the GraalVM LLVM runtime is the GC. In general, I'm not sure it's a good idea to have two GCs in a single VM. And on the implementation side, we probably have to teach the GC how to walk GraalVMs stack, which looks different than the native stack.