Optimising First-Class Pattern Matching

Conference Paper (2022)
Author(s)

J. Smits (TU Delft - Programming Languages)

Toine Hartman (External organisation)

Jesper Cockx (TU Delft - Programming Languages)

DOI related publication
https://doi.org/10.1145/3567512.3567519 Final published version
More Info
expand_more
Publication Year
2022
Language
English
Related content
Pages (from-to)
74-83
ISBN (print)
978-1-4503-9919-7
Event
Downloads counter
220
Collections
Institutional Repository
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

Pattern matching is a high-level notation for programs to analyse the shape of data, and can be optimised to efficient low-level instructions. The Stratego language uses first-class pattern matching, a powerful form of pattern matching that traditional optimisation techniques do not apply to directly.
In this paper, we investigate how to optimise programs that use first-class pattern matching. Concretely, we show how to map first-class pattern matching to a form close to traditional pattern matching, on which standard optimisations can be applied.
Through benchmarks, we demonstrate the positive effect of these optimisations on the run-time performance of Stratego programs. We conclude that the expressive power of first-class pattern matching does not hamper the optimisation potential of a language that features it.