TY - CHAP
T1 - Embedding invertible languages with binders
T2 - A case of the FliPpr language
AU - Matsuda, Kazutaka
AU - Wang, Meng
N1 - Funding Information:
The work was partially supported by JSPS KAKENHI Grant Numbers 15K15966 and 15H02681, and by Royal Society International Exchanges Grant: Bidirectional Compiler for Software Evolution, IES\R3\170104.
Publisher Copyright:
© 2018 ACM.
PY - 2018/9/17
Y1 - 2018/9/17
N2 - This paper describes a new embedding technique of invertible programming languages, through the case of the FliPpr language. Embedded languages have the advantage of inheriting host languages' features and supports; and one of the influential methods of embedding is the tagless-final style, which enables a high level of programmability and extensibility. However, it is not straightforward to apply the method to the family of invertible/reversible/bidirectional languages, due to the different ways functions in such domains are represented. We consider FliPpr, an invertible pretty-printing system, as a representative of such languages, and show that Atkey et al.'s unembedding technique can be used to address the problem. Together with a reformulation of FliPpr, our embedding achieves a high level of interoperability with the host language Haskell, which is not found in any other invertible languages. We implement the idea and demonstrate the benefits of the approach with examples.
AB - This paper describes a new embedding technique of invertible programming languages, through the case of the FliPpr language. Embedded languages have the advantage of inheriting host languages' features and supports; and one of the influential methods of embedding is the tagless-final style, which enables a high level of programmability and extensibility. However, it is not straightforward to apply the method to the family of invertible/reversible/bidirectional languages, due to the different ways functions in such domains are represented. We consider FliPpr, an invertible pretty-printing system, as a representative of such languages, and show that Atkey et al.'s unembedding technique can be used to address the problem. Together with a reformulation of FliPpr, our embedding achieves a high level of interoperability with the host language Haskell, which is not found in any other invertible languages. We implement the idea and demonstrate the benefits of the approach with examples.
KW - EDSL
KW - Parsing
KW - Pretty-Printing
KW - Program Inversion
UR - http://www.scopus.com/inward/record.url?scp=85084846366&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85084846366&partnerID=8YFLogxK
U2 - 10.1145/3242744.3242758
DO - 10.1145/3242744.3242758
M3 - Chapter
AN - SCOPUS:85084846366
VL - 53
SP - 158
EP - 171
BT - ACM SIGPLAN Notices
PB - Association for Computing Machinery
ER -