Compiling a functional logic language: the basic scheme

  • Authors:
  • Sergio Antoy;Arthur Peters

  • Affiliations:
  • Computer Science Dept., Portland State University, Oregon;Computer Science Dept., Portland State University, Oregon

  • Venue:
  • FLOPS'12 Proceedings of the 11th international conference on Functional and Logic Programming
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present the design of a compiler for a functional logic programming language and discuss the compiler's implementation. The source program is abstracted by a constructor based graph rewriting system obtained from a functional logic program after syntax desugaring, lambda lifting and similar transformations provided by a compiler's front-end. This system is non-deterministic and requires a specialized normalization strategy. The target program consists of 3 procedures that execute graph replacements originating from either rewrite or pull-tab steps. These procedures are deterministic and easy to encode in an ordinary programming language. We describe the generation of the 3 procedures, discuss the correctness of our approach, highlight some key elements of an implementation, and benchmark the performance of a proof-of-concept. Our compilation scheme is elegant and simple enough to be presented in one page.