skip to main content
10.1145/207110.207123acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free Access

A type-based compiler for standard ML

Authors Info & Claims
Published:01 June 1995Publication History

ABSTRACT

Compile-time type information should be valuable in efficient compilation of statically typed functional languages such as Standard ML. But how should type-directed compilation work in real compilers, and how much performance gain will type-based optimizations yield? In order to support more efficient data representations and gain more experience about type-directed compilation, we have implemented a new type-based middle end and back end for the Standard ML of New Jersey compiler. We describe the basic design of the new compiler, identify a number of practical issues, and then compare the performance of our new compiler with the old non-type-based compiler. Our measurement shows that a combination of several simple type-based optimizations reduces heap allocation by 36%; and improves the already-efficient code generated by the old non-type-based compiler by about 19% on a DECstation 500.

References

  1. 1.William E. Aitken and John H. Reppy. Abstract value constructors: Symbolic constants for Standard ML. Technical Report TR 92-1290, Department of Computer Science, Cotnell University, June 1992. A shorter version appears in the proceedings of the "ACM SIGPLAN Workshop on ML and its Applications," 1992.Google ScholarGoogle Scholar
  2. 2.Andrew W. Appel. A runtlme system. Lisp and Symbolic Computation, 3(4):343-80, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.Andrew W. Appel. Compiling with Continuations. Cambridge University Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.Andrew W. Appel and Trevor Jim. Continuation-passing, closure-passing style. In Sixteenth A CM Syrup. on Principles of Programming Languages, pages 293-302, New York, 1989. ACM Press. Google ScholarGoogle Scholar
  5. 5.Andrew W. Appel and David B. MacQueen. Standard ML of New Jersey. In Martin Wirsing, editor, Third Int'I Syrup. on Prog. Lang. Implementation and Logic Programming, pages 1-13, New York, August 1991. Springer-Verlag.Google ScholarGoogle Scholar
  6. 6.Andrew W. Appel and Zhong Shao. Callee-save registers in continuation-passing style. Lisp and Symbolic Cornputatton, 5:189-219, September 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.Nikolaj S. Bjorner. Minimial typing derivations. In A CM SIGPLAN Workshop on ML and its Applications, pages 120- 126, June 1994.Google ScholarGoogle Scholar
  8. 8.Craig Chambers. The Design and bnplementation of the SELF Compiler, an Optimizbzg Compiler for Object-Orielzted Programming Languages. PhD thesis, Stanford University, Stanford,California, March 1992. Tech Report STAN-CS- 92-1420. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.Craig Chambers and David Ungar. Customization: Optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language. In Proc. ACM SIG- PLAN '89 Conf. on Prog. Lang. Design and hnplementati~n' pages I46-160, New York, July 1989. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.Luis Damas and Robin Milner. Principal type-schemes for functional programs. In Ninth A CM Symposium on Principles of Programming Languages, pages 207-12, New York, 1982. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.Robert Harper and Mark Lillibridge. A type-theoretic approach to higher-order modules with sharing. In %t'enn' First AnnltalACM S3,mp. on Principles of Prog. Langttages, pages 123-137, New York, Jan 1994. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.Robert Harper and Greg Morrisett. Compiling polymorphlsm using intenslonal type analysis. In T~ventv-second Annlta{ A CM &'mp. on Prtnciples of Prog. La,~lguages, pages 130- 141, New York, Jan 1995. ACM Press. Google ScholarGoogle Scholar
  13. 13.Fritz Henglein and Jesper Jorgensen. Formally optimal boxing. In Proc. 21st Annual A CM SIGPLAN-SIGA CT &'rap. on Principles of Programming Languages, pages 213-226. ACM Press, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.David Kranz. ORBIT.' An opttmtzing compiler for Scheme. PhD thesis, Yale University, New Haw~n, CT, I987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15.Xavier Leroy. Unboxed objects and polymorphic typing. In Nineteenth Annual A CM ~'rap. on Prit,lciples of Prog. Languages, pages 177-188, New York, January I992. ACM Press. Google ScholarGoogle Scholar
  16. 16.Xavier Leroy. Manifest types, modules, and separate compilation. In TweJzt~' First Annual A CM Syrup. ot~ Principles of Prog. Languages, pages 109-122, New York, Jan 1994. ACM Press. Google ScholarGoogle Scholar
  17. 17.Dawd B. MacQueen and Mads Tofte. A semantics for higher-order functors. In Proc. Ettropea~'z Symposium on Programmhlg (ESOP'94), pages 409-423, April 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18.Robin Milner and Mads Torte. Commentary on Standard ML. MIT Press, Cambridge, Massachusetts, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19.Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, Cambridge, MA, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 20.Simon L. Peyton Jones and John Launchbury. Unboxed values as first class cit;zens in a non-strict functional language. In The Fifth International Conference on Functional Programming Languages and Computer A~vhitecture, pages 636-666, New York, August 1991. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 21.Eigil Poulsen, Representation analysis for efficient implementation of polymorph~sm. Master's thes~s, DiKU, University of Copenhagen, 1993.Google ScholarGoogle Scholar
  22. 22.Zhong Shao. Compiling Standard ML for Efficient Execution on Modern Machines. PhD thesis, Princeton University, Princeton, NJ, November 1994. Tech Report CS-TR-475-94. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 23.Zhong Shao and Andrew W. Appel. Space-efficient closure representations. In Proc. 1994 A CM Conf on Lisp and Ftmctional Programming, pages 150-16 I. ACM Press, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 24.Guy L. Steele. Rabbit: a compiler for Scheme. Technical Report AI-TR-474, MIT, Cambridge. MA, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 25.Mads Torte. Prlnc~pal signatures t br higher-order program modules. In Nineteenth Annual A CM &vmp. on Principles of Prog. Languages, pages 189-199, New York, Jan 1992. ACM Press. Google ScholarGoogle Scholar
  26. 26.David M. Ungar. The Design and Evaluation of a High Performance Smatttalk System. MIT Press., Cambridge, MA, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A type-based compiler for standard ML

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                PLDI '95: Proceedings of the ACM SIGPLAN 1995 conference on Programming language design and implementation
                June 1995
                335 pages
                ISBN:0897916972
                DOI:10.1145/207110

                Copyright © 1995 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 1 June 1995

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • Article

                Acceptance Rates

                PLDI '95 Paper Acceptance Rate28of105submissions,27%Overall Acceptance Rate406of2,067submissions,20%

                Upcoming Conference

                PLDI '24

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader