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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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.
T. Amtoft and F. Turbak. Faithful translations between polyvariant flows and polymorphic types. In ESOP’ 00 [ESOP00], pp. 26–40.
A. Banerjee. A modular, polyvariant, and type-based closure analysis. In ICFP’ 97 [ICFP97].
N. Benton, A. Kennedy, and G. Russell. Compiling Standard ML to Java bytecodes. In ICFP’ 98 [ICFP98]
H.-J. Boehm. Space efficient conservative garbage collection. In Proc. ACM SIGPLAN’ 93 Conf. Prog. Lang. Design & Impl., pp. 197–206, 1993.
H. Cejtin, S. Jagannathan, and S. Weeks. Flow-directed closure conversion for typed languages. In ESOP’ 00 [ESOP00], pp. 56–71.
K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type erasure semantics. In ICFP’ 98 [ICFP98], pp. 301–312.
A. Dimock, R. Muller, F. Turbak, and J. B. Wells. Strongly typed flow-directed representation transformations. In ICFP’ 97 [ICFP97], pp. 11–24.
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.
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.
R. Fitzgerald, T. Knoblock, E. Ruf, B. Steensgaard, and D. Tarditi. Marmot: An optimizing compiler for Java. Technical Report 99-33, Microsoft Research, 1999.
L. George. MLRISC: Customizable and reusable code generators. Technical report, Bell Labs, 1997.
F. Henglein. Simple closure analysis. Technical Report D-193, DIKU, Mar. 1992.
J. Hannan and P. Hicks. Higher-order uncurrying. In POPL’ 98 [POPL98], pp. 1–11.
Proc. 1997 Int’l Conf. Functional Programming. ACM Press, 1997.
Proc. 1998 Int’l Conf. Functional Programming. ACM Press, 1998.
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.
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.
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.
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.
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.
L. Mauborgne. Improving the representation of in nite trees to deal with sets of trees. In ESOP’ 00 [ESOP00], pp. 275–289.
J. C. Mitchell. Foundations for Programming Languages. MIT Press, 1996.
Y. Minamide, G. Morrisett, and R. Harper. Typed closure conversion. In Conf. Rec. POPL’ 96: 23rd ACM Symp. Princ. of Prog. Langs., 1996.
G. Morrisett. Compiling with Types. Ph.D. thesis, Carnegie Mellon University, 1995.
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.
G. C. Necula. Proof-carrying code. In POPL’ 97 [POPL97], pp. 106–119.
F. Nielson and H. R. Nielson. In nitary control flow analysis: A collecting semantics for closure analysis. In POPL’ 97 [POPL97], pp. 332–345.
B. C. Pierce. Programming with intersection types, union types, and polymorphism. Technical Report CMU-CS-91-106, Carnegie Mellon University, Feb. 1991.
S. L. Peyton Jones. Compiling Haskell by program transformation: A report from the trenches. In Proc. European Symp. on Programming, 1996.
S. L. Peyton Jones and E. Meijer. Henk: A typed intermediate language. In TIC’ 97 [TIC97].
Conf. Rec. POPL’ 97: 24th ACM Symp. Princ. of Prog. Langs., 1997.
Conf. Rec. POPL’ 98: 25th ACM Symp. Princ. of Prog. Langs., 1998.
J. Palsberg and C. Pavlopoulou. From polyvariant flow information to intersection and union types. J. Funct. Programming, 200X. To appear.
O. Shivers. Control Flow Analysis of Higher Order Languages. Ph.D. thesis, Carnegie Mellon University, 1991.
J. M. Siskind. Flow-directed lightweight closure conversion. Technical Report 99-190R, NEC Research Institute, Inc., Dec. 1999.
Z. Shao, C. League, and S. Monnier. Implementing typed intermediate languages. In ICFP’ 98 [ICFP98], pp. 313–323.
P. Steckler and M. Wand. Lightweight closure conversion. ACM Trans. on Prog. Langs. & Systs., 19(1):48–86, Jan. 1997.
D. Tarditi. Design and Implementation of Code Optimizations for a Type-Directed Compiler for Standard ML. Ph.D. thesis, Carnegie Mellon University, Dec. 1996.
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/.
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.
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.
A. Tolmach. Tag-free garbage collection using explict type parameters. In Proc. 1994 ACM Conf. LISP Funct. Program., pp. 1–11, 1994.
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].
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].
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.
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
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