Skip to main content

Program Representation Size in an Intermediate Language with Intersection and Union Types

  • Conference paper
  • First Online:
Types in Compilation (TIC 2000)

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

Included in the following conference series:

Abstract

The CIL compiler for core Standard ML compiles whole programs using a novel typed intermediate language (TIL) with intersection and union types and flow labels on both terms and types. The CIL term representation duplicates portions of the program where intersection types are introduced and union types are eliminated. This duplication makes it easier to represent type information and to introduce customized data representations. However, duplication incurs compile-time space costs that are potentially much greater than are incurred in TILs employing type-level abstraction or quantification. In this paper, we present empirical data on the compile-time space costs of using CIL as an intermediate language. The data shows that these costs can be made tractable by using sufficiently fine-grained flow analyses together with standard hash-consing techniques. The data also suggests that non-duplicating formulations of intersection (and union) types would not achieve significantly better space complexity.

Partially supported by NSF grant CCR-9417382.

Partially supported by Sun grant EDUD-7826-990410-US.

Partially supported by NSF CISE/CCR ESS grant 9806747.

Partially supported by a Faculty Fellowship of the Carroll School of Management, Boston College.

Partially supported by EPSRC grants GR/L 36963 and GR/L 15685.

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.

References

  1. O. Agesen. The Cartesian product algorithm. In Proceedings of ECOOP’95, Seventh European Conference on Object-Oriented Programming, vol. 952, pp. 2–26. Springer-Verlag, 1995.

    Google Scholar 

  2. T. Amtoft and F. Turbak. Faithful translations between polyvariant flows and polymorphic types. In ESOP’ 00 [ESOP00], pp. 26–40.

    Google Scholar 

  3. A. Banerjee. A modular, polyvariant, and type-based closure analysis. In ICFP’ 97 [ICFP97].

    Google Scholar 

  4. N. Benton, A. Kennedy, and G. Russell. Compiling Standard ML to Java bytecodes. In ICFP’ 98 [ICFP98]

    Google Scholar 

  5. H.-J. Boehm. Space efficient conservative garbage collection. In Proc. ACM SIGPLAN’ 93 Conf. Prog. Lang. Design & Impl., pp. 197–206, 1993.

    Google Scholar 

  6. H. Cejtin, S. Jagannathan, and S. Weeks. Flow-directed closure conversion for typed languages. In ESOP’ 00 [ESOP00], pp. 56–71.

    Google Scholar 

  7. K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type erasure semantics. In ICFP’ 98 [ICFP98], pp. 301–312.

    Google Scholar 

  8. A. Dimock, R. Muller, F. Turbak, and J. B. Wells. Strongly typed flow-directed representation transformations. In ICFP’ 97 [ICFP97], pp. 11–24.

    Google Scholar 

  9. A. Dimock, I. Westmacott, R. Muller, F. Turbak, J. B. Wells, and J. Considine. Program representation size in an intermediate language with intersection and union types. Technical Report BUCS-TR-2001-02, Comp. Sci. Dept., Boston Univ., Mar. 2001.

    Google Scholar 

  10. K.-F. Faxéen. The costs and bene ts of cloning in a lazy functional language. In Trends in Functional Programming, Volume 2. Intellect, 2001.

    Google Scholar 

  11. R. Fitzgerald, T. Knoblock, E. Ruf, B. Steensgaard, and D. Tarditi. Marmot: An optimizing compiler for Java. Technical Report 99-33, Microsoft Research, 1999.

    Google Scholar 

  12. L. George. MLRISC: Customizable and reusable code generators. Technical report, Bell Labs, 1997.

    Google Scholar 

  13. F. Henglein. Simple closure analysis. Technical Report D-193, DIKU, Mar. 1992.

    Google Scholar 

  14. J. Hannan and P. Hicks. Higher-order uncurrying. In POPL’ 98 [POPL98], pp. 1–11.

    Google Scholar 

  15. Proc. 1997 Int’l Conf. Functional Programming. ACM Press, 1997.

    Google Scholar 

  16. Proc. 1998 Int’l Conf. Functional Programming. ACM Press, 1998.

    Google Scholar 

  17. S. L. P. Jones and A. L. M. Santos. A transformation-based optimiser for Haskell. Sci. Comput. Programming, 32(1-3):3–47, Sept. 1998.

    Article  MATH  Google Scholar 

  18. S. Jagannathan and S. Weeks. A unified treatment of flow analysis in higher-order languages. In Conf. Rec. 22nd Ann. ACM Symp. Princ. of Prog. Langs., pp. 393–407, 1995.

    Google Scholar 

  19. S. Jagannathan, S. Weeks, and A. Wright. Type-directed flow analysis for typed intermediate languages. In Proc. 4th Int’l Static Analysis Symp., vol. 1302 of LNCS. Springer-Verlag, 1997.

    Chapter  Google Scholar 

  20. F. Kamareddine and A. Ríos. A λ-calculus àa la de Bruijn with explicit substitution. In 7th Int’l Symp. Prog. Lang.: Implem., Logics & Programs, PLILP’ 95, vol. 982 of LNCS, pp. 45–62. Springer-Verlag, 1995.

    Chapter  Google Scholar 

  21. A. J. Kfoury and J. B. Wells. Principality and decidable type inference for finite-rank intersection types. In Conf. Rec. POPL’ 99: 26th ACM Symp. Princ. of Prog. Langs., pp. 161–174, 1999.

    Google Scholar 

  22. L. Mauborgne. Improving the representation of in nite trees to deal with sets of trees. In ESOP’ 00 [ESOP00], pp. 275–289.

    Google Scholar 

  23. J. C. Mitchell. Foundations for Programming Languages. MIT Press, 1996.

    Google Scholar 

  24. Y. Minamide, G. Morrisett, and R. Harper. Typed closure conversion. In Conf. Rec. POPL’ 96: 23rd ACM Symp. Princ. of Prog. Langs., 1996.

    Google Scholar 

  25. G. Morrisett. Compiling with Types. Ph.D. thesis, Carnegie Mellon University, 1995.

    Google Scholar 

  26. G. Morrisett, D. Walker, K. Crary, and N. Glew. From System F to typed assembly language. ACM Trans. on Prog. Langs. & Systs., 21(3):528–569, May 1999.

    Google Scholar 

  27. G. C. Necula. Proof-carrying code. In POPL’ 97 [POPL97], pp. 106–119.

    Google Scholar 

  28. F. Nielson and H. R. Nielson. In nitary control flow analysis: A collecting semantics for closure analysis. In POPL’ 97 [POPL97], pp. 332–345.

    Google Scholar 

  29. B. C. Pierce. Programming with intersection types, union types, and polymorphism. Technical Report CMU-CS-91-106, Carnegie Mellon University, Feb. 1991.

    Google Scholar 

  30. S. L. Peyton Jones. Compiling Haskell by program transformation: A report from the trenches. In Proc. European Symp. on Programming, 1996.

    Google Scholar 

  31. S. L. Peyton Jones and E. Meijer. Henk: A typed intermediate language. In TIC’ 97 [TIC97].

    Google Scholar 

  32. Conf. Rec. POPL’ 97: 24th ACM Symp. Princ. of Prog. Langs., 1997.

    Google Scholar 

  33. Conf. Rec. POPL’ 98: 25th ACM Symp. Princ. of Prog. Langs., 1998.

    Google Scholar 

  34. J. Palsberg and C. Pavlopoulou. From polyvariant flow information to intersection and union types. J. Funct. Programming, 200X. To appear.

    Google Scholar 

  35. O. Shivers. Control Flow Analysis of Higher Order Languages. Ph.D. thesis, Carnegie Mellon University, 1991.

    Google Scholar 

  36. J. M. Siskind. Flow-directed lightweight closure conversion. Technical Report 99-190R, NEC Research Institute, Inc., Dec. 1999.

    Google Scholar 

  37. Z. Shao, C. League, and S. Monnier. Implementing typed intermediate languages. In ICFP’ 98 [ICFP98], pp. 313–323.

    Google Scholar 

  38. P. Steckler and M. Wand. Lightweight closure conversion. ACM Trans. on Prog. Langs. & Systs., 19(1):48–86, Jan. 1997.

    Article  Google Scholar 

  39. D. Tarditi. Design and Implementation of Code Optimizations for a Type-Directed Compiler for Standard ML. Ph.D. thesis, Carnegie Mellon University, Dec. 1996.

    Google Scholar 

  40. Proc. First Int’l Workshop on Types in Compilation June 1997. The printed TIC’ 97 proceedings is Boston Coll. Comp. Sci. Dept. Tech. Rep. BCCS-97-03. The individual papers are available at http://www.cs.bc.edu/~muller/TIC97/ or http://oak.bc.edu/~muller/TIC97/.

  41. D. Tarditi, G. Morrisett, P. Cheng, C. Stone, R. Harper, and P. Lee. TIL: A type-directed optimizing compiler for ML. In Proc. ACM SIGPLAN’ 96 Conf. Prog. Lang. Design & Impl., 1996.

    Google Scholar 

  42. A. P. Tolmach and D. Oliva. From ML to Ada: Strongly-typed language interoperability via source translation. J. Funct. Programming, 8(4):367–412, 1998.

    Article  MATH  Google Scholar 

  43. A. Tolmach. Tag-free garbage collection using explict type parameters. In Proc. 1994 ACM Conf. LISP Funct. Program., pp. 1–11, 1994.

    Google Scholar 

  44. J. B. Wells, A. Dimock, R. Muller, and F. Turbak. A typed intermediate language for flow-directed compilation. In Proc. 7th Int’l Joint Conf. Theory & Practice of Software Development, pp.757–771, 1997. Superseded by [WDMT0X].

    Google Scholar 

  45. J. B. Wells, A. Dimock, R. Muller, and F. Turbak. A calculus with polymorphic and polyvariant flow types. J. Funct. Programming, 200X. To appear. Supersedes [WDMT97].

    Google Scholar 

  46. M. Wand and P. Steckler. Selective and lightweight closure conversion. In Conf. Rec. 21st Ann. ACM Symp. Princ. of Prog. Langs., pp. 435–445, 1994.

    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

Dimock, A., Westmacott, I., Muller, R., Turbak, F., Wells, J.B., Considine, J. (2001). Program Representation Size in an Intermediate Language with Intersection and Union Types. In: Harper, R. (eds) Types in Compilation. TIC 2000. Lecture Notes in Computer Science, vol 2071. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45332-6_2

Download citation

  • DOI: https://doi.org/10.1007/3-540-45332-6_2

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42196-2

  • Online ISBN: 978-3-540-45332-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics