Tools and libraries to model and manipulate circular programs

Joo Paulo Fernandes, Joo Saraiva

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

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.

Original languageEnglish (US)
Title of host publicationPEPM 2007
Subtitle of host publicationProceedings of the Workshop on Partial Evaluation and Program Manipulation
Pages102-111
Number of pages10
DOIs
StatePublished - 2007
Event2007 ACM SIGPLAN Workshop Partial Evaluation and Semantics-Based Program Manipulation - Nice, France
Duration: Jan 15 2007Jan 16 2007

Publication series

NameProceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation

Conference

Conference2007 ACM SIGPLAN Workshop Partial Evaluation and Semantics-Based Program Manipulation
Country/TerritoryFrance
CityNice
Period1/15/071/16/07

Keywords

  • Circular programming
  • Intermediate data structures
  • Multiple traversal algorithms
  • Traversal scheduling

ASJC Scopus subject areas

  • Software

Fingerprint

Dive into the research topics of 'Tools and libraries to model and manipulate circular programs'. Together they form a unique fingerprint.

Cite this