by JonChesterfield · 3y ago · 0 comments
Mutable state with serialise/deserialise either breaks the aliasing or needs some way to keep the referenced variables alive (nasty interaction with garbage collection) and to re-establish aliasing on deserialise.
Serialising a DAG to a tree tends to duplicate the previously shared nodes. There's then the question of whether deserialising the tree should re-establish the original sharing or some other sharing. Serialising a graph to a (finite) tree needs some notation to represent the cycles.
It looks to me like mutable state is the blocker but I'd be interested in other opinions.
(define a (list "a"))
(set-cdr! a a)