A Binding Scope Analysis for Generic Programs on Arrays

Performance of generic array programs crucially relies on program specialisation wrt. shape information. Traditionally, this is done in a rather ad hoc fashion by propagating all shape information that is available. When striving for a compositional programming style that adheres to good software engineering principles this approach turns out to be insufficient. Instead, static value information needs to be propagated as well which introduces all the well known problems of partial evaluation in general. In this paper, we propose a static analysis that identifies to what extent specialisation needs to be employed in order to achieve a certain level of shape information. This narrows the scope of specialisation far enough to make specialisation for shape information feasible despite a compositional programming style. Some examples to this effect are presented.

[1]  Sjaak Smetsers,et al.  Optimizing Generic Functions , 2004, MPC.

[2]  Todd L. Veldhuizen,et al.  Arrays in Blitz++ , 1998, ISCOPE.

[3]  Clemens Grelck,et al.  Accelerating APL programs with SAC , 1998, APL.

[4]  Denis Caromel,et al.  Computing in Object-Oriented Parallel Environments , 2002, Lecture Notes in Computer Science.

[5]  Sven-Bodo Scholz,et al.  Single Assignment C: efficient support for high-level array operations in a functional setting , 2003, Journal of Functional Programming.

[6]  Paul Steckler,et al.  The Functional Imperative: Shape! , 1998, ESOP.

[7]  Lawrence Snyder,et al.  The implementation and evaluation of fusion and contraction in array languages , 1998, PLDI '98.

[8]  Ralf Hinze,et al.  The Generic Haskell user's guide , 2001 .

[9]  Ralf Hinze,et al.  The generic HASKELL user's guide : version 0.99 - Amber release , 2001 .

[10]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[11]  Roger K. W. Hui Rank and Uniformity , 1995, APL.

[12]  David C. Cann,et al.  Compilation techniques for high-performance applicative computation , 1989 .

[13]  Todd L. Veldhuizen C++ Templates as Partial Evaluation , 1999, PEPM.

[14]  Neil D. Jones,et al.  An introduction to partial evaluation , 1996, CSUR.

[15]  Peter G. Harrison,et al.  Functional Programming , 1988 .

[16]  Simon L. Peyton Jones,et al.  Derivable Type Classes , 2001, Haskell.

[17]  Dietmar Kreye,et al.  A compiler backend for generic programming with arrays , 2004 .

[18]  Artem Alimarine,et al.  Generic functional programming conceptual design, implementation and applications , 2005 .

[19]  Clemens Grelck,et al.  Implicit Memory Management for SAC. , 2004 .

[20]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.