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

Flexible representation analysis

Published: 01 August 1997 Publication History
  • Get Citation Alerts
  • Abstract

    Statically typed languages with Hindley-Milner polymorphism have long been compiled using inefficient and fully boxed data representations. Recently, several new compilation methods have been proposed to support more efficient and unboxed multi-word representations. Unfortunately, none of these techniques is fully satisfactory. For example, Leroy's coercion-based approach does not handle recursive data types and mutable types well. The type-passing approach (proposed by Harper and Morrisett) handles all data objects, but it involves extensive runtime type analysis and code manipulations.This paper presents a new flexible representation analysis technique that combines the best of both approaches. Our new scheme supports unboxed representations for recursive and mutable types, yet it only requires little runtime type analysis. In fact, we show that there is a continuum of possibilities between the coercion-based approach and the type-passing approach. By varying the amount of boxing and the type information passed at runtime, a compiler can freely explore any point in the continuum---choosing from a wide range of representation strategies based on practical concerns. Finally, our new scheme also easily extends to handle type abstractions across ML-like higher-order modules.

    References

    [1]
    A. W. Appel. Compiling with Continuations. Cambridge University Press, 1992.
    [2]
    A. W. Appel. A critque of Standard ML. Journal of Functional Programming, 3(4):391-429, October 1993.
    [3]
    A. W. Appel and D. B. MacQueen. Standard ML of New Jersey. In M. Wirsing, editor, Third lnt'I Syrup. on Prog. Lang. Implementation and Logic Programming, pages 1-13, New York, August 1991. Springer-Verlag.
    [4]
    J. Auslander, M. Philipose, C. Chambers, S. Eggers, and B. Bershad. Fast, effective dynamic compilation. In Proc. A CM SIGPLAN '96 Con}. on Prog. Lang. Design and Implementation, pages 149-159. ACM Press, 1996.
    [5]
    M. W. Bailey and J. W. Davidson. A formal model of procedure calling convention. In Twenty-second Annual ACM Syrup. on Principles of Prog. Languages, pages 298-310, New York, Jan 1995. ACM Press.
    [6]
    N. S. Bjorner. Minimal typing derivations. In A CM SIG- PLAN Workshop on ML and its Applications, pages 120- 126, june 1994.
    [7]
    D. Clement, J. Despeyroux, T. Despeyroux, and G. Kahn. A simple applicative language: Mini-ML. In 1986 A CM Conference on Lisp and Functional Programming, New York, June 1986. ACM Press.
    [8]
    L. Damns and R. Milner. Principal type-schemes for functional programs. In Ninth Annual A CM Syrup. on Principles of Prog. Languages, pages 207-212, New York, Jan 1982. ACM Press.
    [9]
    D. R. Engler. VCODE: A retargetable, extensible, very fast dynamic code generation system. In Proc. A CM SIGPLAN '96 Conf. on Prog. Lang. Design and Implementation, pages 160-170. ACM Press, 1996.
    [10]
    J. Y. Girard. Interpretation Fonctionnelle et Elimination des Coupures dana l'Arithmetiq~e d'Ordre Superieur. PhD thesis, University of Paris VII, 1972.
    [11]
    R. Harper and M. Lillibridge. A type-theoretic approach to higher-order modules with sharing. In Twenty-first Annual ACM Syrup. on Principles of Prog. Languages, pages 123- 137, New York, Jan 1994. ACM Press.
    [12]
    R. Harper and J. C. Mitchell. On the type structure of Standard ML. ACM Trans. Prog. Lang. Syst., 15(2):211-252, April 1993.
    [13]
    R. Harper and G. Morrisett. Compiling polymorphism using intensional type analysis. Technical Report CMU-CS-94- 185, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, September 1994.
    [14]
    R. Harper and G. Morrisett. Compiling polymorphism using intensional type analysis. In Twenty-second Annual ACM Syrup. on Principles o! Prog. Languages, pages 130-141, New York, Jan 1995. ACM Press.
    [15]
    F. Henglein and J. Jorgensen. Formally optimal boxing. In Proc. 21st Annual ACM SIGPLAN-SIGACT Syrup. on Principles of Programming Languages, pages 213-226. ACM Press, 1994.
    [16]
    M. P. Jones. Dictionary-free overloading by partial evaluation. In Proceedings of the A CM $IGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pages 107-117. University of Melbourne TR 94}9, June 1994.
    [17]
    G. Kane and J. Heinrich, editors. MIPS RISU Architecture. Prentice Hall, Englewood Cliffs, N J, 1992.
    [18]
    P. Lee and M. Leone. Optimizing ML with run-time code generation. In Proc. A CM SIGPLAN '96 Conf. on Prog. Lang. Design and Implementation, pages 137-148. ACM Press, 1996.
    [19]
    X. Leroy. Unboxed objects and polymorphic typing. In Nineteenth Annaal A C'M Syrup. on Principles of Prog. Languages, pages 177-188, New York, Jan 1992. ACM Press. Longer version available as INRIA Tech Report.
    [20]
    X. Leroy. Manifest types, modules, and separate compilation. In Twenty-first Annual A CM Syrup. on Principles of Prog. Languages, pages 109-122, New York, Jan 1994. ACM Press.
    [21]
    D. B. MacQueen and M. Tofte. A semantics for higher order functors. In The 5th European Symposium on Programming, pages 409-423, Berlin, April 1994. Spinger-Verlag.
    [22]
    R. Milner, M. Tofte, and R. Harper. The Definition of S~andard ML. MiT Press, Cambridge, Massachusetts, 1990.
    [23]
    R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definiiion of Standard ML (Revised). MIT Press, Cambridge, Massachusetts, 1997.
    [24]
    G. Morrisett. Compiling with Types. PhD thesis, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, December 1995. Tech Report CMU-CS-95-226.
    [25]
    R. Morrison, A. Dearie, R. C. H. Connor, and A. L. Brown. An ad hoe approach to the implementation of polymorphism. A CM Trans. Prog. Lang. Syst., 13(3), July 1991.
    [26]
    S. L. Peyton Jones mid J. Launchbury. Unboxed values as first class citizens in a non-strict functional language. In The Fifth International Conference on Functional Programming Languages and Computer Architecture, pages 636-666, New York, August 1991. ACM Press.
    [27]
    E. Poulsen. Representation analysis for efficient implementation of polymorphism. Master's thesis, DIKU, University of Copenhagen, 1993.
    [28]
    J.C. Reynolds. Towards a theory of type structure. In Proceedings, Colloque sur la Programmation, Lecture Note8 in Computer Science, volume 19, pages 408-425. Springer- Verlag, Berlin, 1974.
    [29]
    Z. Shao. Compili~9 Standard ML .{or Efficient Execution on Modern Machines. PhD thesis, Princeton University, Princeton, NJ, November 1994. Tech Report CS-TR-475-94.
    [30]
    Z. Shao. Flexible representation analysis. Technical Report YALEU/DCS/RR-1125, Dept. of Computer Science, Yale University, New Haven, CT, 1997.
    [31]
    Z. Shao. A overview of the FLINT/ML compiler. In To appear in 1997 A CM Workshop on Types in Compilation, June 1997.
    [32]
    Z. Shao. Typed cross-module compilation. Technical Report YALEU/DCS/RR-1126, Dept. of Computer Science, Yale University, New Haven, CT, 1997.
    [33]
    Z. Shao and A. W. Appel. A type-based compiler for Stundard ML. In Proc. A CM SlGPLAN '95 Conf. on Prog. Lang. Design and Implementation, pages 116-129. ACM Press, 1995.
    [34]
    D. Tarditi, G. Morrisett, P. Chang, C. Stone, R. Harper, and P. Lee. TIL: A type-directed optimizing compiler for ML. In Proc. A CM SIGPLAN '96 Con}. on Prop. Lang. Design and lmplemegtation, pages 181-192. ACM Press, 1996.
    [35]
    D. R. Tarditi. Design and Implementation of Code Optimizations .{or a Type-Directed Compiler/or Standard ML. PhD thesis, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, December 1996. Tech Report CMU-CS-97-108.
    [36]
    P. J. Thiemann. Unboxed values and polymorphic typing revisited. In The Seventh International Conferer~ce on Functional Programming Languages and Computer Architecture, pages 24-35, New York, June 1995. Spinger-Verlag.
    [37]
    A. K. Wright. Polymorphism for imperative languages without imperative types. Technical Report Tech Report TR 93- 200, Dept. of Computer Science, Rice University, Houston, Texas, February 1993.

    Cited By

    View all
    • (2019)Inductive types deconstructed: the calculus of united constructionsProceedings of the 4th ACM SIGPLAN International Workshop on Type-Driven Development10.1145/3331554.3342607(52-63)Online publication date: 18-Aug-2019
    • (2018)Finitary polymorphism for optimizing type-directed compilationProceedings of the ACM on Programming Languages10.1145/32367762:ICFP(1-29)Online publication date: 30-Jul-2018
    • (2017)Specialization of Generic Array Accesses After InliningElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.241.4241(45-53)Online publication date: 7-Feb-2017
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ICFP '97: Proceedings of the second ACM SIGPLAN international conference on Functional programming
    August 1997
    326 pages
    ISBN:0897919181
    DOI:10.1145/258948
    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 August 1997

    Permissions

    Request permissions for this article.

    Check for updates

    Qualifiers

    • Article

    Conference

    ICFP97
    Sponsor:
    ICFP97: International Conference on Functional Programming 1997
    June 9 - 11, 1997
    Amsterdam, The Netherlands

    Acceptance Rates

    ICFP '97 Paper Acceptance Rate 25 of 78 submissions, 32%;
    Overall Acceptance Rate 333 of 1,064 submissions, 31%

    Upcoming Conference

    ICFP '24

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)60
    • Downloads (Last 6 weeks)7

    Other Metrics

    Citations

    Cited By

    View all
    • (2019)Inductive types deconstructed: the calculus of united constructionsProceedings of the 4th ACM SIGPLAN International Workshop on Type-Driven Development10.1145/3331554.3342607(52-63)Online publication date: 18-Aug-2019
    • (2018)Finitary polymorphism for optimizing type-directed compilationProceedings of the ACM on Programming Languages10.1145/32367762:ICFP(1-29)Online publication date: 30-Jul-2018
    • (2017)Specialization of Generic Array Accesses After InliningElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.241.4241(45-53)Online publication date: 7-Feb-2017
    • (2015)Automating ad hoc data representation transformationsACM SIGPLAN Notices10.1145/2858965.281427150:10(801-820)Online publication date: 23-Oct-2015
    • (2015)Automating ad hoc data representation transformationsProceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications10.1145/2814270.2814271(801-820)Online publication date: 23-Oct-2015
    • (2014)Late data layoutACM SIGPLAN Notices10.1145/2714064.266019749:10(397-416)Online publication date: 15-Oct-2014
    • (2014)Late data layoutProceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications10.1145/2660193.2660197(397-416)Online publication date: 15-Oct-2014
    • (2008)Typed closure conversion preserves observational equivalenceProceedings of the 13th ACM SIGPLAN international conference on Functional programming10.1145/1411204.1411227(157-168)Online publication date: 20-Sep-2008
    • (2008)Typed closure conversion preserves observational equivalenceACM SIGPLAN Notices10.1145/1411203.141122743:9(157-168)Online publication date: 20-Sep-2008
    • (2007)A type-preserving closure conversion in haskellProceedings of the ACM SIGPLAN workshop on Haskell workshop10.1145/1291201.1291212(83-92)Online publication date: 30-Sep-2007
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media