Skip to content

Structural Diffs

Wilfred Hughes edited this page Jun 24, 2021 · 12 revisions

Tree Diffs

Most tree diff implementations focus on XML, and there's a great overview of techniques in this blog post.

Jane Street's patdiff implements a tree diff, using an A* algorithm.

prettydiff

prettydiff does really well out of the box with the sample files here. It implements LCS on words.

wu-diff

wu-diff doesn't have much documentation, but it gives the same results as other LCS implementations in Rust.

JSON diff

json-diff provides a proper structural diff for JSON files.

graphtage

graphtage compares structured data by parsing into a generic file format, then displaying a diff. It finds the optimal edit sequence, and even allows things like diffing JSON against YAML.

Lisp diffs

sdiff and diff-sexp explore s-expression oriented diffs.

Autochrome is a structural diff for Clojure, using Dijkstra pathfinding.

Clone this wiki locally