KIT | KIT-Bibliothek | Impressum | Datenschutz

Concise, Type-Safe, and Efficient Structural Diffing

Erdweg, Sebastian ORCID iD icon 1; Szabó, Tamás; Pacak, André
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

A structural diffing algorithm compares two pieces of tree-shaped data and computes their difference. Existing structural diffing algorithms either produce concise patches or ensure type safety, but never both. We present a new structural diffing algorithm called truediff that achieves both properties by treating subtrees as mutable, yet linearly typed resources. Mutation is required to derive concise patches that only mention changed nodes, but, in contrast to prior work, truediff guarantees all intermediate trees are well-typed. We formalize type safety, prove truediff has linear run time, and evaluate its performance and the conciseness of the derived patches empirically for real-world Python documents. While truediff ensures type safety, the size of its patches is on par with Gumtree, a popular untyped diffing implementation. Regardless, truediff outperforms Gumtree and a typed diffing implementation by an order of magnitude.


Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Proceedingsbeitrag
Publikationsdatum 18.06.2021
Sprache Englisch
Identifikator ISBN: 978-1-4503-8391-2
KITopen-ID: 1000188600
Erschienen in Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI); Online, 20.-25.06.2021
Veranstaltung 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (2021), Online, 20.06.2021 – 25.06.2021
Verlag Association for Computing Machinery (ACM)
Seiten S. 406-419
Schlagwörter incremental computing; tree diffing
Nachgewiesen in Scopus
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page