Compiling pattern matching to in-place modifications - Archive ouverte HAL
Conference Papers Year : 2021

Compiling pattern matching to in-place modifications

Abstract

Algebraic data types and pattern matching are popular tools to build programs manipulating complex datastructures in a safe yet efficient manner. On top of its safety advantages, compilation techniques can turn pattern matching into highly efficient deconstruction code for immutable use cases. Conversely, high-performance datastructures and languages prefer to leverage (controlled) mutations to maximize time and memory efficiency. Algebraic data types provide a natural framework to efficiently describe \emph{in-place} transformations as rewrite rules. Such representation coul take advantage of parallelism opportunities that appear in tree-like structures. We present early steps towards a new technique to compile pattern matching as parallel in-place modifications of the underlying memory representation. Towards this goal, we combine the usual language approach which is common in pattern-matching compilation with tools from the polyhedral model, which is commonly used in high-performance code generation to output efficient C code. We present our formalism, along with a prototype implementation.
Fichier principal
Vignette du fichier
gpce2021-cursors.pdf (573.75 Ko) Télécharger le fichier
Origin Files produced by the author(s)

Dates and versions

hal-03355377 , version 1 (18-10-2021)

Identifiers

Cite

Paul Iannetta, Laure Gonnord, Gabriel Radanne. Compiling pattern matching to in-place modifications. GPCE 2021 - 20th International Conference on Generative Programming: Concepts & Experiences, Oct 2021, Chicago & Virtual, United States. ⟨10.1145/3486609.3487204⟩. ⟨hal-03355377⟩
284 View
240 Download

Altmetric

Share

More