Compiling contextual objects: bringing higher-order abstract syntax to programmers

  • Authors:
  • Francisco Ferreira;Stefan Monnier;Brigitte Pientka

  • Affiliations:
  • McGill University, Montréal, PQ, Canada;Université de Montréal, Montréal, PQ, Canada;McGill University, Montréal, PQ, Canada

  • Venue:
  • PLPV '13 Proceedings of the 7th workshop on Programming languages meets program verification
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Binders in data-structures representing code or proofs can be represented in a variety of ways, from low-level first-order representations such as de Bruijn indices to higher-order abstract syntax (HOAS), with nominal logic somewhere in-between. HOAS is arguably the cleanest and highest-level representation but comes with significant problems in expressiveness and efficiency. The Beluga language addresses this expressiveness problem by providing a powerful pattern matching facility as well as explicit control over contexts. This work aims to solve one important efficiency concern by showing how to compile Beluga down to lower-level primitives. It does so by compiling Beluga's binders into an intermediate first-order representation that abstracts over the eventual low-level representation, and by adapting ML-style pattern compilation to the more general case of Beluga's patterns. As an important side benefit, our work clarifies the connection between programming with HOAS in Beluga and programming with first-order approaches based on names.