Abstract Syntax Graphs for Domain Specific Languages
Bruno C.d.S. Oliveira, Andres Löh

This paper presents a representation for embedded domain specific languages (EDSLs) using abstract syntax graphs (ASGs). The purpose of this representation is to deal with the important problem of defining operations that require observing or preserving sharing and recursion in EDSLs in an expressive, yet easy-to-use way. In contrast to more conventional representations based on abstract syntax trees, ASGs represent sharing and recursion explicitly as binder constructs. We use a functional representation of ASGs based on structured graphs, where binders are encoded with parametric higher-order abstract syntax. We show how adapt to this representation to well-typed ASGs. This is especially useful for EDSLs, which often reuse the type system of the host language. We also show an alternative class-based encoding of (well-typed) ASGs that enables extensible and modular well-typed EDSLs while allowing the manipulation of sharing and recursion.

Download
ACM DL Author-ize serviceAbstract syntax graphs for domain specific languages
Bruno C. d. S. Oliveira, Andres Löh
PEPM '13 Proceedings of the ACM SIGPLAN 2013 workshop on Partial evaluation and program manipulation, 2013
Older draft, rejected from Haskell 2012
Code bundle for the paper

Valid XHTML 1.0! Valid CSS!

Andres Löh, 2013-03-29