Fork me on GitHub

I rewrote the diff algorithm to run in cljs using rewrite-clj for the parser. Basically it works by walking the input and allocating an entire shadow universe of cons cells into some arrays, so that it can then pretend the indexes are pointers. There is an extremely rudimentary demo here and the code is here . The object identity hacks are ALMOST gone, but there is now js/Map to associate the annotations with rendered forms (js Map is by identity when keys are objects). This is because the position metadata returned by rewrite-clj is not enough to uniquely identify a form, since two forms could occupy the same textual position range in two different input files.


@russell cool! I'll take a closer look soon!