Edit time immutability
This may sound paradox. How can one edit something immutable?
Resolving this is that immutable in computer science merely means not in place mutable. Not in place overwritable.
Adding a new value out of place keeping the old one(s) around is allowed though.
(Entropically one can write on a known state not forcing kT energy dissipation not limiting one to the Landau limit, but that's not the focus here.)
Edit time immutable means e.g. that keyboard input say into an UI input box does (in memory) not overwrite what was in there before but rather adds a next version. And the UI in default mode always displays this newest version.
Contents
What is the point of edit time immutability?
Time traveling debugger
(wiki-TODO: Elaborate on this, there is some info on that out there on the web.)
Code projection to various structural editors - code diffing
Structural editors come with a lot of benefits that textual code can't provide.
See the linked page for details.
As for challenges:
For one thing they needing to migrate schema changes across branches that evolved in different ways.
Edit time immutability on top of an immutable (per function hash addressed) code database can hugely helps with that.
Structural changes of the ADTs in the AST database caused by manual editing become immutably anchored in the AST database
If there is an alternate branch that forked off earlier that shall be synchronized to then
structural (ADT) changes can be traced backwards to the common branch-points, and from there forward again to the alternate branch.
A nearest common ancestor in schema can be synthesized beforehand.
A minimal smart diff of natural representation that is a bit more discovered than invented.
Exploring a codebase multiverse (via ALDs)
Editing in annotated lambda diagrams actually internally does not mutate the code-AST/ADT-database.
So when changing an input field manually then what actually happens is
that one sees a different part of the codebase multiverse.
This is visually indistinguishable from an actual mutation.
One might want to do that for using it as undo history graph (not list or tree).
Or for educative purposes.
(wiki-TODO: Discuss this further.)
Related
External links
- [1] Syncing schema changes across branches would hugely benefit from edit time immutability