202106211538 - Motivation

This note is more about what motivates me to dig into 202106211536 - Using input-output-hk.github.io haskell.nix, the requirement to run generated code while compiling a haskell binary. This requirement seems to be fulfilled via the approach input-output-hk take.

Nevertheless this exact requirement is one I have to check all other approaches to be taking it into account, thus it’s fullfillment is driving a general motivation to dig into the cross platform area as well.

As https://www.tweag.io/blog/2020-11-25-asterius-th/ (via https://github.com/NixOS/nixpkgs/issues/124284#issuecomment-861432498) states certain parts of haskell code will run at compile time as soon as Template Haskell is used, so when building on build machines with one instruction set for host machines with another instruction set, the codes run at compile time may if not fail from the start be translated disorthogonally and fail subtly at runtime. The thing to be done is some RPC sorcery via so-called iserv enabling to communicate to an emulator (be wine or qemu whatsoever), which itself does all the foreign platform computation pushing back the results to build machines ghc. It is said that haskell.nix includes this at least for cross-compiling to Windows host machines. My hope and aim of this essay is it supported cross-compiling to aarch64 as well.