TY - GEN
T1 - Generating mutually recursive definitions
AU - Yallop, Jeremy
AU - Kiselyov, Oleg
N1 - Funding Information:
We thank Nada Amin and Jun Inoue for helpful discussions and posed challenges, and Atsushi Igarashi for hospitality. We are grateful to anonymous reviewers for many helpful suggestions. This work was partially supported by JSPS KAK-ENHI Grant Number 18H03218.
Publisher Copyright:
© 2019 Copyright held by the owner/author(s). Publication rights licensed to ACM.
PY - 2019/1/14
Y1 - 2019/1/14
N2 - Many functional programs - state machines [Krishnamurthi 2006], top-down and bottom-up parsers [Hinze and Paterson 2003; Hutton and Meijer 1996], evaluators [Abelson et al. 1984], GUI initialization graphs [Syme 2006], &c. - are conveniently expressed as groups of mutually recursive bindings. One therefore expects program generators, such as those written in MetaOCaml, to be able to build programs with mutual recursion. Unfortunately, currently MetaOCaml can only build recursive groups whose size is hard-coded in the generating program. The general case requires something other than quotation, and seemingly weakens static guarantees on the resulting code. We describe the challenges and propose a new language construct for assuredly generating binding groups of arbitrary size - illustrating with a collection of examples for mutual, n-ary, heterogeneous, value and polymorphic recursion.
AB - Many functional programs - state machines [Krishnamurthi 2006], top-down and bottom-up parsers [Hinze and Paterson 2003; Hutton and Meijer 1996], evaluators [Abelson et al. 1984], GUI initialization graphs [Syme 2006], &c. - are conveniently expressed as groups of mutually recursive bindings. One therefore expects program generators, such as those written in MetaOCaml, to be able to build programs with mutual recursion. Unfortunately, currently MetaOCaml can only build recursive groups whose size is hard-coded in the generating program. The general case requires something other than quotation, and seemingly weakens static guarantees on the resulting code. We describe the challenges and propose a new language construct for assuredly generating binding groups of arbitrary size - illustrating with a collection of examples for mutual, n-ary, heterogeneous, value and polymorphic recursion.
KW - Fixed points
KW - Metaprogramming
KW - Multi-stage programming
KW - Recursion
UR - http://www.scopus.com/inward/record.url?scp=85061805425&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85061805425&partnerID=8YFLogxK
U2 - 10.1145/3294032.3294078
DO - 10.1145/3294032.3294078
M3 - Conference contribution
AN - SCOPUS:85061805425
T3 - PEPM 2019 - Proceedings of the 2019 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, Co-located with POPL 2019
SP - 75
EP - 81
BT - PEPM 2019 - Proceedings of the 2019 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, Co-located with POPL 2019
A2 - Hermenegildo, Manuel
A2 - Igarashi, Atsushi
PB - Association for Computing Machinery, Inc
T2 - 2019 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2019, in affiliation with the annual Symposium on Principles of Programming Languages, POPL 2019
Y2 - 14 January 2019 through 15 January 2019
ER -