Compilation of Haskell array comprehensions for scientific computing

  • Authors:
  • Steven Anderson;Paul Hudak

  • Affiliations:
  • Yale University, Department of Computer Science, Box 2158 Yale Station, New Haven CT;Yale University, Department of Computer Science, Box 2158 Yale Station, New Haven CT

  • Venue:
  • PLDI '90 Proceedings of the ACM SIGPLAN 1990 conference on Programming language design and implementation
  • Year:
  • 1990

Quantified Score

Hi-index 0.00

Visualization

Abstract

Monolithic approaches to functional language arrays, such as Haskell array comprehensions, define elements all at once, at the time the array is created, instead of incrementally. Although monolithic arrays are elegant, a naive implementation can be very inefficient. For example, if a compiler does not know whether an element has zero or many definitions, it must compile runtime tests. If a compiler does not know inter-element data dependencies, it must resort to pessimistic strategies such as compiling elements as thunks, or making unnecessary copies when updating an array.Subscript analysis, originally developed for imperative language vectorizing and parallelizing compilers, can be adapted to provide a functional language compiler with the information needed for efficient compilation of monolithic arrays. Our contribution is to develop the number-theoretic basis of subscript analysis with assumptions appropriate to functional arrays, detail the kinds of dependence information subscript analysis can uncover, and apply that dependence information to sequential efficient compilation of functional arrays.