New Document: The HaLVM 2.0 Deep Dive, or What is the difference between GHC and the HaLVM?



Always wonder how the HaLVM is constructed? This wiki page describes how the HaLVM is constructed out of its component parts, and how we modified GHC to make the whole thing work. It might be a pretty good place to start if you wanted to start diving into the HaLVM code base.

If any questions pop up after reading it, feel free to post them here.


FYI I wrote an email proposing a variant of TH with the host platform’s semantics, which resulted in this issue about making multi-target GHCs (opening the door to linking a TH-runner or other backend support to a once-compiled target-agnostic middle-end).

I imagine both of these things would greatly benefit HalVM (and GHCJS, CλaSH, etc).


Absolutely. Basically, anything that makes cross-compiling in GHC less of a problem makes the HaLVM much easier to write. In fact, I would love it if eventually GHC grew to take over all the work in the HaLVM, so there wasn’t this separation between the two. I don’t think that’s really a major interest or priority for the GHC team, though.


I’d think that a platform/backend-agnostic libGHC, whose source and build could be reused for HalVM, is a reasonable thing to hope for someday that wouldn’t but an extra burden on a GHC team.