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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994. (DIKU report 94/19).
A. Bondorf. Automatic autoprojection of higher-order recursion equations. In N. Jones, editor, 3rd European Symposium on Programming, LNCS, Copenhagen, 1990. Springer-Verlag.
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.
C. Consel and P. Jouvelot. Separate Polyvariant Binding-Time Analysis. Technical Report CS/E 93-006, Oregon Graduate Institute Tech, 1993.
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.
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.
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.
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.
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.
R. Heldal and J. Hughes. Extending a partial evaluator which supports separate compilation. Theoretical Computer Science 248, pages 99–145, 2000.
Rogardt Heldal. The Treatment of Polymorphism and Modules in a Partial Evaluator. PhD thesis, Chalmers University of Technology, April 2001.
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.
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.
N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.
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.
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.
J. Launchbury. Projection Factorisations in Partial Evaluation (PhD thesis), volume 1 of Distinguished Dissertations in Computer Science. Cambridge University Press, 1991.
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.
R. Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and Systems Sciences, 17:348–375, 1978.
R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.
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.
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.
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.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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