Fork me on GitHub
#autochrome-github
<
2022-02-22
>
russell17:02:15

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 https://fazzone.github.io/autochrome/ and the code is here https://github.com/fazzone/autochrome/commit/134f4c4d12d7dc80cf5e2172bc910921e0be109e . 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.

borkdude17:02:00

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