RE: [stack] Reversible computation and Joy

wtanksley@bigfoot.com — 2000-05-15 17:20:27

From: srenner@... [mailto:srenner@...]

>If Joy is understood as linear (currently a topic of debate here),

It undeniably can be made so, if it isn't already.

>then is a Joy computation reversible? My intuition is that Joy can be
>made reversible if "garbage" is not collected during a computation
>but pushed onto a "garbage stack".

>[2 2 +] i == 4
>3 1 + == 4
>2 sq == 4
>123 121 - == 4

>Given 4 on the stack, what information do we need to reconstruct the
>computation that created it? Isn't this information exactly the same
>as the "garbage" we would normally collect?

I don't think so -- I think you'd need to have (for example) + return both
the answer and one of the addends. So

[2 2 +] i == 4 [2 2 +] ( ? )
3 1 + == 1 4
2 sq == 4
123 121 - == 121 4

I'm not sure about how to handle the quotation unwrapping, honestly.

-Billy