Generic conversions of abstract syntax representations

  • Authors:
  • Steven Keuchel;Johan T. Jeuring

  • Affiliations:
  • Universiteit Gent, Gent, Belgium;Utrecht Universiteit and Open Universiteit Nederland, Utrecht, Netherlands

  • Venue:
  • Proceedings of the 8th ACM SIGPLAN workshop on Generic programming
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper we present a datatype-generic approach to syntax with variable binding. A universe specifies the binding and scoping structure of object languages, including binders that bind multiple variables as well as sequential and recursive scoping. Two interpretations of the universe are given: one based on parametric higher-order abstract syntax and one on well-typed de Bruijn indices. The former provides convenient interfaces to embedded domain-specific languages, but is awkward to analyse and manipulate directly, while the latter is a convenient representation in implementations, but is unusable as a surface language. We show how to generically convert from the parametric HOAS interpretation to the de Bruijn interpretation thereby taking the pain from DSL developer to write the conversion themselves.