Friends,<div><br></div><div>I'd like to ask a possible quite ignorant question. Can GHC produce an external representation of GHC byte code, and load that byte code back up? If it's just an internal representation is there any good reason for this? </div><div><br></div><div>It seems to me that this would be useful for at least a few reasons:</div><div><br></div><div>1. This could solve the Template Haskell on cross compiler's dilemma. Currently, the problem is that a cross compiler will produce object code for the target machine which cannot be run on the host machine. But if this were bytecode the problem would be trivial to solve.</div><div><br></div><div>2. You could transmit Haskell programs over the network to run on arbitrary machines.</div><div><br></div><div>3. <span style="font-size:13.1999998092651px">As it stands GHC sometimes has long standing bugs where it produces incorrect machine code on some architectures for various (fairly boring) reasons. Interpreting bytecode might be less efficient but would at least ensure that you could, in principle, run GHC on a variety of different platforms until these bugs are finally squashed.</span></div><div><br></div><div>Sean</div>