2

Full disclosure, I'm asking this after watching a couple pop science videos; I do not know anything about the actual physics and hardware. I suspect the presenters expected an audience like me because they explained irreversibility at the level of a programming language ( irreversible_add(a, b) = a+b erases information; reversible_add(a, b) = (a, a+b) does not ) and simply said "reversibility must be at every level of abstraction".

Would such an irreversible programming language have to use mutable objects to avoid erasing information? In contrast, some programming languages treat primitive types as immutable, so a statement like a += 1 would create a new number, rebind the name a to that new number, and discard the old number. For example, this means reversible_add(a, b) = (a, a+b) would in fact discard the number bound to the name b.

Almost all sources that I have run across talk about reversibility at a hardware level (logic gates). I did find a source about immutable objects (strings) in a reversible programming language (Arrow), but reading it didn't answer my question.

BatWannaBe
  • 365
  • 2
  • 9

1 Answers1

1

No. For example,

c := a
d := a+b

avoids erasing information; but it does not use any mutable objects (c,d can be fresh variables that are assigned only once). It is not clear to me why you think that avoiding information erasure requires mutable objects, or what is the exact definition of an irreversible programming language.

D.W.
  • 167,959
  • 22
  • 232
  • 500