Generic Conversions of Abstract Syntax Representations [pdf] [bib]

Steven Keuchel and Johan T. Jeuring.
Published in Proceedings of the 8th ACM SIGPLAN workshop on Generic programming, 2012

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.

BibTeX

@inproceedings{genconv,
  author =    "Keuchel, Steven and Jeuring, Johan T.",
  title =     "{G}eneric {C}onversions of {A}bstract {S}yntax
               {R}epresentations",
  booktitle = "Proceedings of the 8th ACM SIGPLAN workshop on 
               Generic programming, \textup{WGP '12}",
  year =      "2012",
  isbn =      "978-1-4503-1576-0",
  pages =     "57--68",
  numpages =  "12",
  doi =       "10.1145/2364394.2364403",
  publisher = "ACM",
  note =      "Copenhagen, Denmark, September 12, 2012"
}