Haskell is a functional language, with features such as higher order functions and lazy evaluation, which allow succinct programs. These high-level features present many challenges for optimising compilers. We report practical experiments using novel variants of supercompilation, with special attention to let bindings and the generalisation technique.


Residual Program Partial Evaluation Word Counting Word Function High Order Function 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Boquist, U., Johnsson, T.: The GRIN project: A highly optimising back end for lazy functional languages. In: Kluge, W. (ed.) IFL 1996. LNCS, vol. 1268, pp. 58–84. Springer, Heidelberg (1997)Google Scholar
  2. 2.
    Coutts, D., Leshchinskiy, R., Stewart, D.: Stream fusion: From lists to streams to nothing at all. In: Proc ICFP 2007, October 2007, pp. 315–326. ACM Press, New York (2007)CrossRefGoogle Scholar
  3. 3.
    Coutts, D., Stewart, D., Leshchinskiy, R.: Rewriting Haskell strings. In: Hanus, M. (ed.) PADL 2007. LNCS, vol. 4354, pp. 50–64. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  4. 4.
    Futamura, Y.: Partial evaluation of computation process - an approach to a compiler-compiler. Higher-Order and Symbolic Computation 12(4), 381–391 (1999)zbMATHCrossRefGoogle Scholar
  5. 5.
    Gill, A., Launchbury, J., Peyton Jones, S.: A short cut to deforestation. In: Proc FPCA 1993, June 1993, pp. 223–232. ACM Press, New York (1993)CrossRefGoogle Scholar
  6. 6.
    Golubovsky, D., Mitchell, N., Naylor, M.: Yhc.Core - from Haskell to Core. The Monad.Reader (7), 45–61 (2007)Google Scholar
  7. 7.
    Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. In: Partial Evaluation and Automatic Program Generation. Prentice-Hall International, Englewood Cliffs (1993)Google Scholar
  8. 8.
    Jonsson, P.A., Nordlander, J.: Positive Supercompilation for a higher order call-by-value language. In: Proc. IFL 2007 (September 2007)Google Scholar
  9. 9.
    Leuschel, M.: Homeomorphic embedding for online termination of symbolic methods. In: The essence of computation: complexity, analysis, transformation, pp. 379–403. Springer, Heidelberg (2002)Google Scholar
  10. 10.
    Marlow, S.: Deforestation for Higher-Order Functional Programs. PhD thesis, University of Glasgow (1996)Google Scholar
  11. 11.
    Marlow, S., Yakushev, A.R., Peyton Jones, S.: Faster laziness using dynamic pointer tagging. In: Proc. ICFP 2007, October 2007, pp. 277–288. ACM Press, New York (2007)CrossRefGoogle Scholar
  12. 12.
    Meacham, J.: jhc: John’s haskell compiler (2007),
  13. 13.
    Mitchell, N., Runciman, C.: Supero: Making Haskell faster. In: Proc. IFL 2007 (September 2007)Google Scholar
  14. 14.
    Partain, W., et al.: The nofib Benchmark Suite of Haskell Programs (2007),
  15. 15.
    Peyton Jones, S.: Implementing lazy functional languages on stock hardware: The spineless tagless G-machine. JFP 2(2), 127–202 (1992)Google Scholar
  16. 16.
    Peyton Jones, S.: Tackling the awkward squad: monadic input/output, concur- rency, exceptions, and foreign-language calls in Haskell. In: Engineering theories of software construction, Marktoberdorf Summer School (2002)Google Scholar
  17. 17.
    Peyton Jones, S.: Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge (2003)Google Scholar
  18. 18.
    Peyton Jones, S.: Call-pattern specialisation for Haskell programs. In: Proc. ICFP 2007, October 2007, pp. 327–337. ACM Press, New York (2007)CrossRefGoogle Scholar
  19. 19.
    Peyton Jones, S., Launchbury, J.: Unboxed values as first class citizens in a non-strict functional language. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 636–666. Springer, Heidelberg (1991)Google Scholar
  20. 20.
    Peyton Jones, S., Partain, W., Santos, A.: Let-floating: Moving bindings to give faster programs. In: Proc. ICFP 1996, pp. 1–12. ACM Press, New York (1996)CrossRefGoogle Scholar
  21. 21.
    Peyton Jones, S., Tolmach, A., Hoare, T.: Playing by the rules: Rewriting as a practical optimisation technique in GHC. In: Proc. Haskell 2001, pp. 203–233. ACM Press, New York (2001)Google Scholar
  22. 22.
    Röjemo, N.: Highlights from nhc - a space-efficient Haskell compiler. In: Proc. FPCA 1995, pp. 282–292. ACM Press, New York (1995)CrossRefGoogle Scholar
  23. 23.
    Secher, J.P., Sørensen, M.H.B.: On perfect supercompilation. In: Bjørner, D., Broy, M., Zamulin, A. (eds.) PSI 1999. LNCS, vol. 1755, pp. 113–127. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  24. 24.
    Sørensen, M.H., Glück, R.: An algorithm of generalization in positive supercompilation. In: Lloyd, J.W. (ed.) Logic Programming: Proceedings of the 1995 International Symposium, pp. 465–479. MIT Press, Cambridge (1995)Google Scholar
  25. 25.
    The GHC Team. The GHC compiler, version 6.8 (November 2007),
  26. 26.
    Tolmach, A.: An External Representation for the GHC Core Language (September 2001),
  27. 27.
    Turchin, V.F.: The algorithm of generalization in the supercompiler. In: Partial Evaluation and Mixed Copmutation, pp. 341–353. North-Holland, Amsterdam (1988)Google Scholar
  28. 28.
    Turchin, V.F.: Refal-5, Programming Guide & Reference Manual. New England Publishing Co., Holyoke (1989)Google Scholar
  29. 29.
    Turchin, V.F.: The concept of a supercompiler. ACM Trans. Program. Lang. Syst. 8(3), 292–325 (1986)zbMATHCrossRefMathSciNetGoogle Scholar
  30. 30.
    Turchin, V.F., Nirenberg, R.M., Turchin, D.V.: Experiments with a supercompiler. In: Proc. LFP 1982, pp. 47–55. ACM, New York (1982)CrossRefGoogle Scholar
  31. 31.
    Wadler, P.: Deforestation: Transforming programs to eliminate trees. In: Ganzinger, H. (ed.) ESOP 1988. LNCS, vol. 300, pp. 344–358. Springer, Heidelberg (1988)Google Scholar
  32. 32.
    Wadler, P., Blott, S.: How to make ad-hoc polymorphism less ad hoc. In: Proc. POPL 1989, pp. 60–76. ACM Press, New York (1989)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Neil Mitchell
    • 1
  • Colin Runciman
    • 1
  1. 1.University of YorkUK

Personalised recommendations