Modern Haskell → C translation approaches?
Hello everyone,
I’m looking for ways to translate modern Haskell code into relatively modern, portable C code.
I previously experimented with the old -fvia-C option from unregistered GHC builds, but it no longer seems to work with modern versions of Haskell.
I also tried a different pipeline: compiling Haskell to LLVM IR using GHC, and then using the LLVM C backend (LLVM CBE) to generate C code. However, the LLVM IR produced by GHC follows Haskell’s runtime and evaluation conventions, which do not map cleanly to the assumptions made by LLVM CBE when generating C.
As a result, I have not been able to obtain a working Haskell → C translation pipeline using this approach.
Does anyone know of any viable approaches or experimental tools that could help achieve Haskell → C translation in a reasonably portable way?
Any pointers or suggestions would be greatly appreciated.
Thanks!
Markus
Discussion in the ATmosphere