Using Template Haskell for Abstract Interpretation

  • Authors:
  • Clara Segura;Carmen Torrano

  • Affiliations:
  • Departamento de Sistemas Informáticos y Programación, Universidad Complutense de Madrid, Madrid, Spain;Departamento de Sistemas Informáticos y Programación, Universidad Complutense de Madrid, Madrid, Spain

  • Venue:
  • Electronic Notes in Theoretical Computer Science (ENTCS)
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Metaprogramming consists of writing programs that generate or manipulate other programs. Template Haskell is a recent extension of Haskell, currently implemented in the Glasgow Haskell Compiler, giving support to metaprogramming at compile time. Our aim is to apply these facilities in order to statically analyse programs and transform them at compile time. In this paper we use Template Haskell to implement an abstract interpretation based strictness analysis and a let-to-case transformation that uses the results of the analysis. This work shows the advantages and disadvantages of the tool in order to incorporate new analyses and transformations into the compiler without modifying it.