TY - GEN
T1 - Tools and libraries to model and manipulate circular programs
AU - Fernandes, Joo Paulo
AU - Saraiva, Joo
PY - 2007
Y1 - 2007
N2 - This paper presents techniques to model circular lazy programs in a strict, purely functional setting. Circular lazy programs model any algorithm based on multiple traversals over a recursive data structure as a single traversal function. Such elegant and concise circular programs are defined in a (strict or lazy) functional language and they are transformed into efficient strict and deforested, multiple traversal programs by using attribute grammars-based techniques. Moreover, we use standard slicing techniques to slice such circular lazy programs. We have expressed these transformations as an Haskell library and two tools have been constructed: the HaCirc tool that refactors Haskell lazy circular programs into strict ones, and the OCirc tool that extends Ocaml with circular definitions allowing programmers to write circular programs in Ocaml notation, which are transformed into strict Ocaml programs before they are executed. The first benchmarks of the different implementations are presented and show that for algorithms relying on a large number of traversals the resulting strict, deforested programs are more efficient than the lazy ones, both in terms of runtime and memory consumption.
AB - This paper presents techniques to model circular lazy programs in a strict, purely functional setting. Circular lazy programs model any algorithm based on multiple traversals over a recursive data structure as a single traversal function. Such elegant and concise circular programs are defined in a (strict or lazy) functional language and they are transformed into efficient strict and deforested, multiple traversal programs by using attribute grammars-based techniques. Moreover, we use standard slicing techniques to slice such circular lazy programs. We have expressed these transformations as an Haskell library and two tools have been constructed: the HaCirc tool that refactors Haskell lazy circular programs into strict ones, and the OCirc tool that extends Ocaml with circular definitions allowing programmers to write circular programs in Ocaml notation, which are transformed into strict Ocaml programs before they are executed. The first benchmarks of the different implementations are presented and show that for algorithms relying on a large number of traversals the resulting strict, deforested programs are more efficient than the lazy ones, both in terms of runtime and memory consumption.
KW - Circular programming
KW - Intermediate data structures
KW - Multiple traversal algorithms
KW - Traversal scheduling
UR - http://www.scopus.com/inward/record.url?scp=35348863697&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=35348863697&partnerID=8YFLogxK
U2 - 10.1145/1244381.1244399
DO - 10.1145/1244381.1244399
M3 - Conference contribution
AN - SCOPUS:35348863697
SN - 1595936203
SN - 9781595936202
T3 - Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation
SP - 102
EP - 111
BT - PEPM 2007
T2 - 2007 ACM SIGPLAN Workshop Partial Evaluation and Semantics-Based Program Manipulation
Y2 - 15 January 2007 through 16 January 2007
ER -