ABSTRACT
We present a translation scheme for the polymorphically typed call-by-value λ-calculus. All runtime values, including function closures, are put into regions. The store consists of a stack of regions. Region inference and effect inference are used to infer where regions can be allocated and de-allocated. Recursive functions are handled using a limited form of polymorphic recursion. The translation is proved correct with respect to a store semantics, which models as a region-based run-time system. Experimental results suggest that regions tend to be small, that region allocation is frequent and that overall memory demands are usually modest, even without garbage collection.
References
- 1.J. Tiuryn A. J. Kfoury and P. Urzyczyn. Type reconstruction in the presence of polymorphic recursion. A CM Transactions on Programming Languages and Systems, 15(2):290-311, April 1993. Google Scholar
Digital Library
- 2.Andrew W. Appel. Compiling with Continuations. Cambridge University Press, 1992. Google Scholar
Digital Library
- 3.Henry G. Baker. Unify and conquer (garbage collection, updating, aliasing, ..) in functional languages. In Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pages 218-226, June 1990. Google Scholar
Digital Library
- 4.H.G. Baker. List processing in real time on a serial computer. Communications of the A CM, 21(4):280-294, April 1978. Google Scholar
Digital Library
- 5.David R. Chase, Safety considerations for storage allocation optimizations. In Proceedings of the SIGPLAN '88 Conference on Programming Language Design and Implementation, pages 1- 10, ACM Press, June 22-24 1988. Google Scholar
Digital Library
- 6.J. M. Lucassen D. K. Gifford, P. Jouvelot and M.A. Sheldon. FX-87 Reference Manual. Technical Report MIT/LCS/TR-407, MIT Laboratory for Computer Science, Sept 1987.Google Scholar
- 7.L. Damas and R. Milner. Principal type schemes for functional programs. In Proc. 9th Annual ACM Symp. on Principles of Programming Languages, pages 207-212, Jan. 1982. Google Scholar
Digital Library
- 8.Jo~lle Despeyroux. Proof of translation in natural semantics. In Proc. of the 1st Symp. on Logic in Computer Science, IEEE, Cambridge, USA, 1986.Google Scholar
- 9.E. W. Dijkstra. Recursive programming. Numerische Math, 2:312-318, 1960. Also in Rosen: "Programming Systems and Languages", McGraw-Hill, 1967. Google Scholar
Digital Library
- 10.Michael Georgeff. Transformations and reduction strategies for typed lambda expressions. A CM Transactions on Programming Languages and Systems, 6(4):603-631, Oct 1984. Google Scholar
Digital Library
- 11.Barry Hayes. Using key object opportunism to collect old objects. In Proceedings: Conference on Object-Oriented Programming Systems, Languages and Applications, Sigplan Notices, Vol 26, Number 11, 1991. Google Scholar
Digital Library
- 12.Fritz Henglein. Type inference with polymorphic recursion. ACM Transactions on Programming Languages and Systems, 15(2):253, April 1993. Google Scholar
Digital Library
- 13.Paul Hudak. A semantic model of reference counting and its abstraction. In A CM Symposium on List and Functional Programming, pages 351- 363, 1986. Google Scholar
Digital Library
- 14.Pierre Jouvelot and D.K. Gifford. Algebraic reconstruction of types and effects. In Proceedings of the 18th A CM Symposium on Principles of Programming Languages (POPL), 1991. Google Scholar
Digital Library
- 15.Hiroyuki Seki Katsuro Inoue and Hikaru Yagi. Analysis of functional programs to detect runtime garbage cells. A CM Transactions on Programming Languages and Systems, 10(4):555- 578, 1988. Google Scholar
Digital Library
- 16./~ke Wikstr6m. Functional Programming Using Standard ML. Series in Computer Science, Prentice Hall, 1987. Google Scholar
Digital Library
- 17.A. Kfoury~ J. Tiuryn, and P. Urzyczyn. The undecidability of the semi-unification problem. In Proc. 22nd Annual A CM Syrup. on Theory of Computation (STOC), Baltimore, Maryland, pages 468-476, May 1990. Google Scholar
Digital Library
- 18.Donald E. Knuth. Fundamental Algorithms. Volume 1 of The Art of Computer Programming, Addison-Wesley, 1972.Google Scholar
- 19.Henry Lieberman and Carl Hewitt. A real-time garbage collector based on the lifetimes of objects. Communications of the A CM, 26(6):419- 429, June 1983. Google Scholar
Digital Library
- 20.J. M. Lucassen. Types and Effects, towards the integration of functional and imperative programming. PhD thesis, MIT Laboratory for Computer Science, 1987. MIT/LCS/TR-408.Google Scholar
- 21.J.M. Lucassen and D.K. Gifford. Polymorphic effect systems. In Proceedings of the 1988 A CM Conference on Principles of Programming Languages, 1988. Google Scholar
Digital Library
- 22.R. Milner. A theory of type polymorphism in programming. J. Computer and System Sciences, 17:348-375, 1978.Google Scholar
Cross Ref
- 23.Robin Milner and Mads Torte. Co-induction in relational semantics. Theoretical Computer Science, 87:209-220, 1991. Google Scholar
Digital Library
- 24.Robin Milner, Mads Torte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990. Google Scholar
Digital Library
- 25.F. L. Morris. Advice on structuring compilers and proving them correct. In Proc. A CM Symp. on Principles of Programming Languages, 1973. Google Scholar
Digital Library
- 26.A. Mycroft. Polymorphic type schemes and recursive definitions. In Proc. 6th Int. Conf. on Programming, LNCS 167, 1984. Google Scholar
Digital Library
- 27.Laurence C. Paulson. ML for the Working Programmer. Cambridge University Press, 1991. Google Scholar
Digital Library
- 28.Cristina Ruggieri and Thomas P. Murtagh. Lifetime analysis of dynamically allocated objects. In Proceedings of the 15th Annual A CM Symposium on Principles of Programming Languages, pages 285-293, January 1988. Google Scholar
Digital Library
- 29.Jean-Pierre Talpin. Theoretical and practical aspects of type and effect inference. Doctoral Dissertation. May 1993. Also available as Research Report EMP/CRI/A-236, Ecole des Mines de Paris.Google Scholar
- 30.Jean-Pierre Talpin and Pierre Jouvelot. Polymorphic type, region and effect inference. Journal of Functional Programming, 2(3), 1992.Google Scholar
Cross Ref
- 31.Mads Tofte and Jean-Pierre Talpin. A Theory of Stack Allocation in Polymorphicalty Typed Languages. Technical Report DIKU-report 93/15, Department of Computer Science, University of Copenhagen, 1993.Google Scholar
Index Terms
Implementation of the typed call-by-value λ-calculus using a stack of regions





Comments