Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/507635.507640acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Functioning without closure: type-safe customized function representations for standard ML

Published: 01 October 2001 Publication History

Abstract

The CIL compiler for core Standard ML compiles whole ML programs using a novel typed intermediate language that supports the generation of type-safe customized data representations. In this paper, we present empirical data comparing the relative efficacy of several different flow-based customization strategies for function representations. We develop a cost model to interpret dynamic counts of operations required for each strategy. In this cost model, customizing the representation of closed functions gives a 12-17% improvement on average over uniform closure representations, depending on the layout of the closure. We also present data on the relative effectiveness of various strategies for reducing representation pollution, i.e., situations where flow constraints require the representation of a value to be less efficient than it would be in ideal circumstances. For the benchmarks tested and the types of representation pollution detected by our compiler, the pollution removal strategies we consider often cost more in overhead than they gain via enabled customizations. Notable exceptions are selective defunctionalization, a function representation strategy that often achieves significant customization benefits via aggressive pollution removal, and a simple form of flow-directed inlining, in which pollution removal allows multiple functions to be inlined at the same call site.

References

[1]
0. Agesen. The Cartesian product algoritliiri. in Proceedings of ECOOP '9.5, Seventh European Conference on Object-Oriented Programming, vol. 952, pp. 2-26. Springer-Verlag, 1995.]]
[2]
A. W. Appel. Compiling with Continuations. Cambridge University Press, 1992.]]
[3]
J. M. Ashley. Flexible And Practical Flow Analysis for Higher-Order Program string Languages. Ph.D. thesis. Indiana University, May 1996.]]
[4]
A. Banergee. A modular, polyvariant, and type-based closure analysis. In ICFP '97 20}.]]
[5]
J. M. Bell, F. Bellegarde, and J. hook. Type-driven defunctionalization, In ICFP '97 {20}. pp. 25-37.]]
[6]
G. E. Blelloch. NESL: A nested data-parallel language. Technical Report CNIU-CS-93-l29, School of Computer Science, Carnegie Mellon University, Apr. 1993.]]
[7]
H.-J. Boehm. Space efficient conservative garbage collection. In Fear. ACM SICPLAN '93 Conf. Prog. Lang. Design & Impl. pp. 197-206, 1993.]]
[8]
H. Cejtin, S. Jagannathan, and S. Weeks. Flow-directed closure conversion for I vped languages. In Progrrnnming Languages P Systems, 9th European Symp. Programming. vol. 1782 of LNCS, pp. 56-71. Springer-Verlag. 2000.]]
[9]
C. Chambers and D. Ungar. Customization: Optimizing compiler technology for Self, a dynamically-typed object-oricnted programming language. In Fear. ACM SIGPLAN '89 Conf. Troy. Lang. Design & ImpI. pp. 116-160, 1989.]]
[10]
C. Chambers and D. Ungar. Iterative type analyse, and extended message splitting: Optimizing dynamically-typed object-oriented programs. In Proc. ACM SIGPLAN '90 (oaf. Frog. Lang. Design & Impl., 1989.]]
[11]
K. D. Cooper, M. W. Hall, and K. Kennedy. A methodology for procedure cloning. Computer Language, 19(2):105 118. 1993.]]
[12]
K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type erasure semantics. In Proc. 1998 Int'l Conf Functional Programming, pp. 301 -312. ACM Press. 1998.]]
[13]
J. Dean, C. Chambers, and D. Grove. Selective specialization for object-oriented languages. In Proc. ACM SIGPLAN '95 Conf. Frog. Lang. Design & Impl., 1995.]]
[14]
A. Dimock, R. Muller, F. Turbak. and J. B. Wells. Strongly typed flow-directed representation transformations. In ICFP '97 {20}, pp. 11 24.]]
[15]
A. Dimock, I. Westmacott, R. Muller, F. Turbak, J. B. Wells and J. Considine. Spare issues in compiling with intersection and union types. In Preliminary Proceedings of the Third Workshop on Types in Compilation (TIC 2000), 2000. Superseded by {16}.]]
[16]
A. Dimock, I. Westmacott, R. Muller, F. Turbak, J. B. Wells. and J. Considine. Program representation size in an intermediate language with intersection arid union types. In Proceedings of the Third Workshop on Types in Compilation (TIC 2000), vol. 2071 of LNCS, pp. 27- 52. Springer-Verlag. 2001. Supersedes {15}.]]
[17]
K.-F. Faxn. The costs and benefits of cloning in a lazy functional language. In Trends in Functional Programming, Volume 2. lntellect, 2001.]]
[18]
L. George. MLRISC: Customizable and reusable code generators. Technical report. Bell Labs, 1997.]]
[19]
J. Hannan and P. Hicks. Higher-order uncurrying. In Conf. Sec. POPL 98: 25th, ACM Syrup. Psinc. of Ping. Longs., pp. 1-11, 1998.]]
[20]
Proc. 1997 Int'l Conf. Functional Programming. ACT Press, 1997.]]
[21]
S. Jagannathan and S. Weeks. A unified treatment n f flow analysis in higher-order languages. In Conf. Sec. 22nd Ann. ACM Syrup. Pnnc. of Frog. Langs. pp.393-407. 1995.]]
[22]
S. Jagannathan, S. Weeks, and A. Wright. Type-directed flow analysis for typed intermediate languages. In Proc. di Intl Static Analysis Symp., vol. 1302 of LNCS. SpringerVerlag, 1997.]]
[23]
M. P. Jones. Dictionary-free overloading by Partial evaluation. In PEPM '94 A CAI SIGPL.4 N Workshop Partial Fred. P Semantics-Based Frog. Manipulation. ACM, 1994.]]
[24]
D. Kranz, R. Kelsey, J. A. Rees, P. Hudak, J. Philbin, and N. I. Adams. Orbit: An optimizing compiler for Scheme. In Proc. SIt1PLA N 86 Symp. Computer Coast ructiorr, pp. '219-233, 1986.]]
[25]
Y. Minamide, G. Morrisett, and R. Harper. Typed closure conversion. In Corrf. Her. POPL '96: 23rd ACM Symp. Prior. of Prog. Langs., 1996.]]
[26]
G. Morrisett, D. Walker, K. Crary, and N. Glew. From System F to typed asseriihly language. A CM Trans. on Prog. Langs. P Systs., 2}(3):528-569, may 1999.]]
[27]
G. Morrisett, D. Walker, K. Crary, and N. Glew. From System F to typed assenrbly language. ACM Trans. on Frog. Longs. P Syst.s., 21(3):528-569, May 1999.]]
[28]
F. Nielson and H. R. Nielson. Infinitary control flow analysis: A collecting semantics for closure analysis. In Coast. Rec. POPL '97: 24th ACM Symp. Pnnc. of Frog. Langs., pp. 332-345. 1997.]]
[29]
D. A. Patterson and J. L. Hennessy. Computer Organization P Design. Morgan Kaufmann. 1998.]]
[30]
J. Plevyak. Optimization of Object-Oriented and Concurrent Programs. Ph.D. thesis, University of Illinois at Urbana-Champaign, 1996.]]
[31]
J. Plevyak and A. Chien. Type directed cloning for object-oriented programs. In Workshop for Languages and Compilers for Parallel Computers, Aug. 1995.]]
[32]
J. Reynolds. Definitional interpreters for higher-order programming languages. In ACM Annual Conference, pp. 717-740, 1972.]]
[33]
0. Shivers. Control Flow Analysis of Higher Order Languages. Ph.D. thesis, Carnegie Mellon University, 1991.]]
[34]
J. M. Siskind. Flow-directed lightweight closure conversion. 'Jchnical Report 99190R, NEC Research Institute, Inc., Dec. 1999.]]
[35]
SPARC International Inc., Nlerrlo Park, CA. The SPARC Architecture Manual, Version 8.]]
[36]
P. SteckIer and M. Wand. Lightweight closure conversion. ACM 'lbans. on Troy. Langs. 84 Systs., 19(1):48-86, Jan. 1997.]]
[37]
Sun Microsystems, Inc. Palo Alto, CA. UItraSPARC User's Manual.]]
[38]
D. Tarditi. Design and Implementation of Code Optimization, for a Type-Dinected Compiler for Standard ML. Ph.D. thesis, Carnegie Mellon University, Dec. 1996,]]
[39]
A. P. Tolmach and D. Oliva. From NIL to Ada: Strongly-typed language interoperahility via source translation. J. Funct, Programming, 8(4):367-412, 1998.]]
[40]
G.-R. Uh and D. B. Whalley. Effectively, exploiting indirectjumps. Software Practice and Experience, 29(12):1061-1101, 1999.]]
[41]
M. Wand and P. Steckler. Selective and lightweight closure conversion, In Conf. Rec. 21st Ann. ACM Symp. Prior. of Prog. Langs., pp. 435-445, 1994.]]
[42]
K. Wansbrough and S. P Jones, Once upon a polymorophic type. In Conf. Sec. FOPL '99: 26th ACM Symnp. Priric. of Frog. Longs. 15- 28, 1999.]]
[43]
J. B. Wells, A. Dimock, R. MulIer, and F. Turbak. A typed intermediate language for flowdirected compilation. In Proc. 7th Int'I Joint Conf. Theory P Practice of Software Development, pp. 757-771, 1997. Superseded by {44}.]]
[44]
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 {43}.]]
[45]
A. Wright and S. Jagannathan. Polymorphic splitling: An effective polyvariant flow analysis. ACM 'Irons. on Prog. Langs. & Systs., 20:166-207, 1998.]]

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '01: Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
October 2001
277 pages
ISBN:1581134150
DOI:10.1145/507635
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 36, Issue 10
    October 2001
    276 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/507669
    Issue’s Table of Contents
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 2001

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

ICFP01
Sponsor:

Acceptance Rates

ICFP '01 Paper Acceptance Rate 23 of 66 submissions, 35%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)21
  • Downloads (Last 6 weeks)1
Reflects downloads up to 04 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Better Defunctionalization through Lambda Set SpecializationProceedings of the ACM on Programming Languages10.1145/35912607:PLDI(977-1000)Online publication date: 6-Jun-2023
  • (2019)Inferring annotated types for inter-procedural register allocation with constructor flatteningACM SIGPLAN Notices10.1145/640136.60418638:3(86-97)Online publication date: 26-Feb-2019
  • (2012)Control-flow analysis of functional programsACM Computing Surveys (CSUR)10.1145/2187671.218767244:3(1-33)Online publication date: 14-Jun-2012
  • (2003)Inferring annotated types for inter-procedural register allocation with constructor flatteningProceedings of the 2003 ACM SIGPLAN international workshop on Types in languages design and implementation10.1145/604174.604186(86-97)Online publication date: 18-Jan-2003
  • (2002)Branching TypesProgramming Languages and Systems10.1007/3-540-45927-8_9(115-132)Online publication date: 14-Mar-2002
  • (2020)The history of Standard MLProceedings of the ACM on Programming Languages10.1145/33863364:HOPL(1-100)Online publication date: 12-Jun-2020

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media