From Interpretation to Compilation

  • Authors:
  • Jan Martin Jansen;Pieter Koopman;Rinus Plasmeijer

  • Affiliations:
  • Faculty of Military Sciences, Netherlands Defence Academy, Den Helder, The Netherlands;Institute for Computing and Information Sciences (ICIS), Radboud University Nijmegen, The Netherlands;Institute for Computing and Information Sciences (ICIS), Radboud University Nijmegen, The Netherlands

  • Venue:
  • Central European Functional Programming School
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper we sketch some experiments with the construction of a simple compiler for a high level intermediate lazy functional language, with C++ as a target language. Because the compiler is intended for educational and experimental use, simplicity and clearness of construction are considered to be more important than efficiency. Starting point for the construction is a simple interpreter. In a first step this interpreter is turned into a simple compiler in a straightforward manner. The performance of a number of compiled benchmarks is analysed in a comparison with the interpreter and the Clean and GHC compilers. This analysis leads to some suggestions for optimisations. Of these optimisations tail recursion optimisation and optimisation of numerical functions and numerical (sub)expressions in functions are implemented. It turns out that in many cases these optimisations suffice to obtain a competitive performance.