The `Jump` instruction is useless
Closed this issue · 2 comments
Since parsley
can perform generic eta-reduction on Template Haskell terms, the tail-call optimisation with Jump
is actually useless.
Its original motivation was to allow call nt ret
to be converted to jump nt
, which would avoid constructing a new return continuation to pass down. However, the form of the return continuation in call nt ret
would be x input -> retCont x input
, which is ultimately eta-reduced to retCont
, which is what is provided by Jump
.
As such, for simplicity, it will be good to drop the Jump
instruction, and ensure eta-reduction is rolled out uniformly, including to the normalisation within Lam
.
Actually, not true! Loop
still uses it to iterate...
But this could be Call nt Ret
or even Call nt Raise
, it doesn't really matter, the retCont
for a loop is Void
...