Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1707790.1707792acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Singleton types here, singleton types there, singleton types everywhere

Published: 19 January 2010 Publication History
  • Get Citation Alerts
  • Abstract

    Singleton types are often considered a poor man's substitute for dependent types. But their generalization in the form of GADTs has found quite a following. The main advantage of singleton types and GADTs is to preserve the so-called phase distinction, which seems to be so important to make use of the usual compilation techniques.
    Of course, they considerably restrict the programmers, which often leads them to duplicate code at both the term and type levels, so as to reflect at the type level what happens at the term level, in order to be able to reason about it.
    In this article, we show how to automate such a duplication while eliminating the problematic dependencies. More specifically, we show how to compile the Calculus of Constructions into λH, a non-dependently-typed language, while still preserving all the typing information. Since λH has been shown to be amenable to type preserving CPS and closure conversion, it shows a way to preserve types when doing code extraction and more generally when using all the common compiler techniques.

    References

    [1]
    Henk P. Barendregt. Lambda calculi with types. In S. Abramsky, D. Gabbay, and T. Maibaum, editors, Handbook of Logic in Computer Science (volume 2). Oxford Univ. Press, 1991.
    [2]
    G. Barthe, J. Hatcliff, and M.H. Sørensen. CPS-translations and applications: the cube and beyond. Higher-Order and Symbolic Computation, 12 (2): 125--170, September 1999.
    [3]
    Thierry Coquand and Gérard P. Huet. The calculus of constructions. Information and Computation, 76: 95--120, 1988.
    [4]
    Karl Crary and Stephanie Weirich. Flexible type analysis. In International Conference on Functional Programming, pages 233--248, Paris, France, September 1999. ACM Press.
    [5]
    Karl Crary, Stephanie Weirich, and Greg Morrisett. Intensional polymorphism in type-erasure semantics. Journal of Functional Programming, 12 (6): 567--600, November 2002.
    [6]
    Matthias Felleisen. On the expressive power of programming languages. Science of Computer Programming, 17 (1-3): 35--75, December 1991.
    [7]
    Kathleen Fisher, John Reppy, and Jon G. Riecke. A calculus for compiling and linking classes. In European Symposium on Programming, volume 1782 of phLNCS, pages 134--149, New York, NY, March/April 2000. Springer-Verlag.
    [8]
    Seth Fogarty, Emir Pašalić, Jeremy Siek, and Walid Taha. Concoqtion: Indexed types now! In Workshop on Partial Evaluation and Semantics-Based Program Manipulation, 2007.
    [9]
    J.Y. Girard. Interprétation Fonctionnelle et Élimination des Coupures dans l'Arithmétique d'Ordre Supérieur. PhD thesis, University of Paris VII, 1972.
    [10]
    Ralf Hinze. Polytypic values possess polykinded types. Science of Computer Programming, 43 (2-3): 129--159, May-June 2002.
    [11]
    Christopher League and Stefan Monnier. Typed compilation against non-manifest base classes. Lecture Notes in Computer Science, 3956: 77--98, January 2006.
    [12]
    Pierre Letouzey. Extraction in coq: An overview. In 4th conference on Computability in Europe: Logic and Theory of Algorithms, pages 359--369, Berlin, Heidelberg, 2008. Springer-Verlag. ISBN 978-3-540-69405-2.
    [13]
    Yasuhiko Minimide, Greg Morrisett, and Robert Harper. Typed closure conversion. In Symposium on Principles of Programming Languages, pages 271--283. ACM Press, January 1996.
    [14]
    Nathan Mishra-Linger and Tim Sheard. Erasure and polymorphism in pure type systems. In Conference on Foundations of Software Science and Computation Structures, volume 4962 of Lecture Notes in Computer Science, pages 350--364, Budapest, Hungary, April 2008.
    [15]
    Stefan Monnier. Typed regions. In Informal proceedings of the SPACE Workshop, Venice, Italy, January 2004.
    [16]
    Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From system F to typed assembly language. In Symposium on Principles of Programming Languages, pages 85--97, January 1998.
    [17]
    Frank Pfenning and Conal Elliott. Higher-order abstract syntax. In Symposium on Programming Languages Design and Implementation, pages 199--208, Atlanta, Georgia, June 1988. ACM Press.
    [18]
    John C. Reynolds. Towards a theory of type structure. In Proceedings, Colloque sur la Programmation, Lecture Notes in Computer Science, volume 19, pages 408--425. Springer-Verlag, Berlin, 1974.
    [19]
    Zhong Shao, Bratin Saha, Valery Trifonov, and Nikolaos Papaspyrou. A type system for certified binaries. In Symposium on Principles of Programming Languages, pages 217--232, January 2002.
    [20]
    Valery Trifonov, Bratin Saha, and Zhong Shao. Fully reflexive intensional type analysis. In International Conference on Functional Programming, pages 82--93, Montréal, Canada, September 2000. ACM Press.

    Cited By

    View all
    • (2021)An existential crisis resolved: type inference for first-class existential typesProceedings of the ACM on Programming Languages10.1145/34735695:ICFP(1-29)Online publication date: 19-Aug-2021
    • (2019)Demo: counterpoint by constructionProceedings of the 7th ACM SIGPLAN International Workshop on Functional Art, Music, Modeling, and Design10.1145/3331543.3342578(22-24)Online publication date: 23-Aug-2019
    • (2018)Suggesting valid hole fits for typed-holes (experience report)ACM SIGPLAN Notices10.1145/3299711.324276053:7(179-185)Online publication date: 17-Sep-2018
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    PLPV '10: Proceedings of the 4th ACM SIGPLAN workshop on Programming languages meets program verification
    January 2010
    70 pages
    ISBN:9781605588902
    DOI:10.1145/1707790
    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

    In-Cooperation

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 19 January 2010

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. certified compilation
    2. dependent types
    3. singleton types

    Qualifiers

    • Research-article

    Conference

    POPL '10
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 18 of 25 submissions, 72%

    Upcoming Conference

    POPL '25

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)21
    • Downloads (Last 6 weeks)1

    Other Metrics

    Citations

    Cited By

    View all

    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