{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigesjvajtyajkaih7d22s34zif3kvajllqnihjfxscz4seqa4i6tm",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mjomgoyf34x2"
  },
  "path": "/t/modern-haskell-c-translation-approaches/13941#post_1",
  "publishedAt": "2026-04-17T08:41:55.000Z",
  "site": "https://discourse.haskell.org",
  "textContent": "Hello everyone,\n\nI’m looking for ways to translate modern Haskell code into relatively modern, portable C code.\n\nI previously experimented with the old `-fvia-C` option from unregistered GHC builds, but it no longer seems to work with modern versions of Haskell.\n\nI 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.\n\nAs a result, I have not been able to obtain a working Haskell → C translation pipeline using this approach.\n\nDoes anyone know of any viable approaches or experimental tools that could help achieve Haskell → C translation in a reasonably portable way?\n\nAny pointers or suggestions would be greatly appreciated.\n\nThanks!\n\nMarkus\n\n* * *",
  "title": "Modern Haskell → C translation approaches?"
}