Skip to main content

The Generalized Intensional Transformation for Implementing Lazy Functional Languages

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7752))

Abstract

The intensional transformation is a promising technique for implementing lazy functional languages based on a demand-driven execution model. Despite its theoretical elegance and its simple and efficient execution model, the intensional transformation suffered, until now, from two main drawbacks: it could only be applied to programs that manipulate primitive data-types and it could only compile a simple (and rather restricted) class of higher-order functions. In this paper we remedy the above two deficiencies, obtaining a transformation algorithm that is applicable to mainstream lazy functional languages. The proposed transformation initially uses defunctionalization in order to eliminate higher-order functions from the source program. The original intensional transformation is then extended in order to apply to the target first-order language with user-defined data types that resulted from the defunctionalization. It is demonstrated that the proposed technique can be used to compile a relatively large subset of Haskell into portable C code whose performance is comparable to existing mainstream implementations.

Work partially supported by the research project “\(\mathrm\Theta\)A\(\mathrm\Lambda\)H\(\mathrm\Sigma-\)EM\(\mathrm\Pi\): Handling uncertainty in data intensive applications on a distributed computing environment (cloud computing)” (MIS 380153), funded by the European Social Fund and the Greek national funds through the Operational Program “Education and Lifelong Learning”.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   49.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Arvind, R.S.N.: Executing a program on the MIT tagged-token dataflow architecture. IEEE Transactions on Computers 39, 300–318 (1990)

    Article  Google Scholar 

  2. Ashcroft, E.A., Faustini, A.A., Jagannathan, R., Wadge, W.W.: Multidimensional Programming. Oxford University Press (1995)

    Google Scholar 

  3. 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)

    Chapter  Google Scholar 

  4. Charalambidis, A., Grivas, A., Papaspyrou, N.S., Rondogiannis, P.: Efficient intensional implementation for lazy functional languages. Mathematics in Computer Science 2(1), 123–141 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  5. De La Encina, A., Peña, R.: From natural semantics to C: A formal derivation of two STG machines. Journal of Functional Programming 19(1), 47–94 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  6. Fourtounis, G., Papaspyrou, N., Rondogiannis, P.: The intensional transformation for functional languages with user-defined data types. In: Proceedings of the 8th Panhellenic Logic Symposium, pp. 38–42 (2011)

    Google Scholar 

  7. Friedman, D.P., Wise, D.S.: CONS should not evaluate its arguments. In: Proceedings of the International Colloquium on Automata, Languages and Programming, pp. 257–284 (1976)

    Google Scholar 

  8. Henderson, P., Jr. Morris, J.H.: A lazy evaluator. In: Proceedings of the 3rd ACM SIGACT-SIGPLAN Symposium on Principles on Programming Languages, pp. 95–103. ACM, New York (1976)

    Google Scholar 

  9. Kirkham, C., Gurd, J., Watson, I.: The Manchester prototype dataflow computer. Communications of the ACM, 34–52 (1985)

    Google Scholar 

  10. Krivine, J.L.: Un interpréteur du lambda-calcul, http://www.pps.univ-paris-diderot.fr/~krivine/articles/interprt.pdf

  11. Partain, W.: The nofib benchmark suite of Haskell programs. In: Proceedings of the 1992 Glasgow Workshop on Functional Programming, pp. 195–202 (1993)

    Google Scholar 

  12. Pingali, K.: Lazy evaluation and the logic variable. In: Proceedings of the 2nd International Conference on Supercomputing, pp. 560–572. ACM, New York (1988)

    Google Scholar 

  13. Plaice, J., Mancilla, B.: The practical uses of TransLucid. In: Proceedings of the 1st International Workshop on Context-aware Software Technology and Applications, pp. 13–16. ACM, New York (2009)

    Google Scholar 

  14. Pottier, F., Gauthier, N.: Polymorphic typed defunctionalization and concretization. Higher-Order and Symbolic Computation 19, 125–162 (2006)

    Article  MATH  Google Scholar 

  15. Reynolds, J.C.: Definitional interpreters for higher-order programming languages. In: Proceedings of the 25th ACM National Conference, pp. 717–740. ACM (1972)

    Google Scholar 

  16. Rondogiannis, P., Wadge, W.W.: First-order functional languages and intensional logic. Journal of Functional Programming 7(1), 73–101 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  17. Rondogiannis, P., Wadge, W.W.: Higher-order functional languages and intensional logic. Journal of Functional Programming 9(5), 527–564 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  18. Traub, K.R.: A compiler for the MIT tagged-token dataflow architecture. Technical report, Massachusetts Institute of Technology, Cambridge, MA, USA (1986)

    Google Scholar 

  19. Wadge, W., Aschroft, E.A.: Lucid, the Dataflow Programming Language. Academic Press (1985)

    Google Scholar 

  20. Yaghi, A.A.: The Intensional Implementation Technique for Functional Languages. Ph.D. thesis, Department of Computer Science, University of Warwick, Coventry, UK (1984)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Fourtounis, G., Papaspyrou, N., Rondogiannis, P. (2013). The Generalized Intensional Transformation for Implementing Lazy Functional Languages. In: Sagonas, K. (eds) Practical Aspects of Declarative Languages. PADL 2013. Lecture Notes in Computer Science, vol 7752. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-45284-0_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-45284-0_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-45283-3

  • Online ISBN: 978-3-642-45284-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics