Hacker News new | ask | show | jobs
by JonChesterfield 1106 days ago
I haven't worked on any of the classic lisp implementations but can speculate. I suppose the ratio of usefulness to difficulty of implementation doesn't work out.

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.

1 comments

Yeah, something like "a" in the below code wouldn't have a "natural" serialization I don't think:

  (define a (list "a"))
  (set-cdr! a a)