Copying host thunks back to the host
In some cases, the interpreter evaluates something without ever unpacking some host thunks, and the result is an unpacked host thunk which can be copied back to the host. Examples are reverse
on a list of lazy expressions, or even hd
on such a list. When these things are copied back to the host, it is not necessary to evaluate them first and then copy them back, that's unnecessary overhead. Instead, we can redirect the host pointer to the interpret node to the node referenced by the host thunk, without using any more heap space. And if that's too complicated, maybe we can create an indirection node, which would still avoid copying between host and interpreter and back.
Edited by Clean Importer