Skip to main content

Binding-Time Analysis for Polymorphic Types

  • Conference paper
  • First Online:
Perspectives of System Informatics (PSI 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2244))

Abstract

Offline partial evaluators specialise programs with annotations which distinguish specialisation-time (or static) computations from run-time ones. These annotations are generated by a binding-time analyser, via type inference in a suitable type-system. Henglein and Mossin developed a type system which allows polymorphism in binding-times, so that the same code can be specialised with different computations being static at different uses. We extend their work to permit polymorphism in types as well. This is particularly important for separately compiled libraries.

Following Henglein and Mossin, binding-times are passed as parameters during specialisation, but types are not. Instead, we pass coercion functions when necessary, which makes specialisation less “interpretive” than it would otherwise be. We keep track of the coercions needed by assigning qualified types to polymorphic functions.

We also consider hand-annotations to provide limited user control over the binding-time analysis, which our prototype implementation showed to be necessary.

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

Access this chapter

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 54.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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994. (DIKU report 94/19).

    Google Scholar 

  2. A. Bondorf. Automatic autoprojection of higher-order recursion equations. In N. Jones, editor, 3rd European Symposium on Programming, LNCS, Copenhagen, 1990. Springer-Verlag.

    Google Scholar 

  3. A. Bondorf. Improving binding times without explicit cps-conversion. In 1992 ACM Conference on Lisp and Functional Programming. San Francisco, California, pages 1–10, June 1992.

    Google Scholar 

  4. C. Consel and P. Jouvelot. Separate Polyvariant Binding-Time Analysis. Technical Report CS/E 93-006, Oregon Graduate Institute Tech, 1993.

    Google Scholar 

  5. Charles Consel. A tour of schism: a partial evaluation system for higher-order applicative languages. In ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 145–154, June 1993.

    Google Scholar 

  6. D. Dussart, R. Heldal, and J. Hughes. Module-Sensitive Program Specialisation. In Conference on Programming Language Design and Implementation, Las Vegas, June 1997. ACM SIGPLAN.

    Google Scholar 

  7. D. Dussart, F. Henglein, and C. Mossin. Polymorphic Recursion and Subtype Qualifications: Polymorphic Binding-Time Analysis in Polynomial Time. In Alan Mycroft, editor, SAS’95: 2nd Int’l Static Analysis Symposium, volume 983 of Lecture Notes in Computer Science, pages 118–135, Glasgow, Scotland, September 1995. Springer-Verlag.

    Google Scholar 

  8. Kevin Glynn, Peter J. Stuckey, Martin Sulzmann, and Harald Söndergård. Boolean constraints for binding-time analysis. In Olivier Danvy and Andrzej Filinski, editors, Second Symposium on Programs as Data Objects, volume 2053 of LNCS, pages 39–62, Aarhus, May 2001. Springer-Verlag.

    Google Scholar 

  9. R. Heldal and J. Hughes. Partial Evaluation and Separate Compilation. In Symposium on Partial Evaluation and Semantics-Based Program Manipulation, Amsterdam, June 1997. ACM SIGPLAN.

    Google Scholar 

  10. R. Heldal and J. Hughes. Extending a partial evaluator which supports separate compilation. Theoretical Computer Science 248, pages 99–145, 2000.

    Google Scholar 

  11. Rogardt Heldal. The Treatment of Polymorphism and Modules in a Partial Evaluator. PhD thesis, Chalmers University of Technology, April 2001.

    Google Scholar 

  12. F. Henglein. Efficient type inference for higher-order binding-time analysis. In J. Hughes, editor, FPCA, pages 448–472. 5th ACM Conference, Cambridge, MA, USA, Springer-Verlag, August 1991. Lecture Notes in Computer Science, Vol. 523.

    Google Scholar 

  13. F. Henglein and C. Mossin. Polymorphic Binding-Time Analysis. In D. Sannella, editor, ESOP’94: European Symposium on Programming, volume 788 of Lecture Notes in Computer Science, pages 287–301. Springer-Verlag, April 1994.

    Google Scholar 

  14. N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.

    Google Scholar 

  15. Neil D. Jones. What not to do when writing an interpreter for specialisation. In Olivier Danvy, Robert Glück, and Peter Thiemann, editors, Partial Evaluation, volume 1110 of Lecture Notes in Computer Science, pages 216–237. Springer-Verlag, 1996.

    Google Scholar 

  16. Simon Peyton Jones, John Hughes, (editors), Lennart Augustsson, Dave Barton, Brian Boutel, Warren Burton, Joseph Fasel, Kevin Hammond, Ralf Hinze, Paul Hudak, Thomas Johnsson, Mark Jones, John Launchbury, Erik Meijer, John Peterson, Alastair Reid, Colin Runciman, and Philip Wadler. Report on the Programming Language Haskell 98, a Non-strict, Purely Functional Language. Available from http://haskell.org, February 1999.

  17. J. Launchbury. Projection Factorisations in Partial Evaluation (PhD thesis), volume 1 of Distinguished Dissertations in Computer Science. Cambridge University Press, 1991.

    Google Scholar 

  18. K. Malmkjær, N. Heintze, and O. Danvy. ML partial evaluation using set-based analysis. In Workshop on ML and its Applications, pages 112–119. ACM SIGPLAN, 1994.

    Google Scholar 

  19. R. Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and Systems Sciences, 17:348–375, 1978.

    Article  MATH  MathSciNet  Google Scholar 

  20. R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.

    Google Scholar 

  21. T. Æ. Mogensen. Binding Time Analysis for Polymorphically Typed Higher Order Languages. In Theory and Practice of Software Development, volume 352 of Lecture Notes in Computer Science, pages 298–312. Springer-Verlag, March 1989.

    Google Scholar 

  22. Zoltan Somogyi, Fergus Henderson, and Thomas Conway. Mercury: an efficient purely declarative logic programming language. In Proceedings of the Australian Computer Science Conference, pages 499–512, Glenelg, Australia, February 1995.

    Google Scholar 

  23. P. Wadler and S. Blott. How to make ad hoc polymorphism less ad hoc. In Proceedings 1989 Symposium Principles of Programming Languages, pages 60–76, Austin, Texas, 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Heldal, R., Hughes, J. (2001). Binding-Time Analysis for Polymorphic Types. In: Bjørner, D., Broy, M., Zamulin, A.V. (eds) Perspectives of System Informatics. PSI 2001. Lecture Notes in Computer Science, vol 2244. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45575-2_19

Download citation

  • DOI: https://doi.org/10.1007/3-540-45575-2_19

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43075-9

  • Online ISBN: 978-3-540-45575-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics