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

Typing unmarshalling without marshalling types

Published: 09 September 2012 Publication History
  • Get Citation Alerts
  • Abstract

    Unmarshalling primitives in statically typed language require, in order to preserve type safety, to dynamically verify the compatibility between the incoming values and the statically expected type. In the context of programming languages based on parametric polymorphism and uniform data representation, we propose a relation of compatibility between (unmarshalled) memory graphs and types. It is defined as constraints over nodes of the memory graph. Then, we propose an algorithm to check the compatibility between a memory graph and a type. It is described as a constraint solver based on a rewriting system. We have shown that the proposed algorithm is sound and semi-complete in presence of algebraic data types, mutable data, polymorphic sharing, cycles, and functional values, however, in its general form, it may not terminate. We have implemented a prototype tailored for the OCaml compiler [17] that always terminates and still seems sufficiently complete in practice.

    References

    [1]
    M. Abadi, L. Cardelli, B. C. Pierce, and D. Rémy. Dynamic typing in polymorphic languages. Journal of Functional Programming, 5 (1): 111--130, Jan. 1995.
    [2]
    S. Aditya and A. Caro. Compiler-directed type reconstruction for polymorphic languages. In FPCA '93: Proceedings of the Conference on Functional Programming Languages and Computer Architecture, pages 74--82, June 1993.
    [3]
    S. Aditya, C. H. Flood, and J. E. Hicks. Garbage collection for strongly-typed languages using run-time type reconstruction. In LFP '94: Proceedings of the 1994 ACM Conference on LISP and Functional ProgrammingcitetLFP:94, pages 12--23.
    [4]
    A. W. Appel. Runtime tags aren't necessary. Lisp and Symbolic Computation, 2 (2): 153--162, July 1989.
    [5]
    J. Billings, P. Sewell, M. R. Shinwell, and R. Strnisa. Type-safe distributed programming for OCaml. In ML'06: Proceedings of the ACM Workshop on ML, pages 20--31, Sept. 2006.
    [6]
    K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type-erasure semantics. In ICFP'98: Proceedings of the 3rd ACM International Conference on Functional Programming, volume 34(1) of SIGPLAN Not., pages 301--312, Sept. 1998.
    [7]
    M. Elsman. Type-specialized serialization with sharing. In TFP'05: Revised Selected Papers from the Sixth Symposium on Trends in Functional Programming, pages 47--62, Sept. 2005.
    [8]
    R. B. Findler and M. Felleisen. Contracts for higher-order functions. In ICFP'02: Proceedings of the 7th ACM International Conference on Functional Programming, volume 37(9) of SIGPLAN Not., pages 48--59, Sept. 2002.
    [9]
    J. Furuse and P. Weis. Input/output of caml values (in french). In JFLA'00: Journées Francophones des Langages Applicatifs. INRIA, Jan. 2000.
    [10]
    B. Goldberg and M. Gloger. Polymorphic type reconstruction for garbage collection without tags. SIGPLAN Lisp Pointers, V (1): 53--65, 1992.
    [11]
    G. Henry. Typing unmarshalling without marshalling types (in french). PhD thesis, Univ Paris Diderot, 2011. URL http://tel.archives-ouvertes.fr/tel-00624156/PDF/these.pdf.
    [12]
    M. Hicks, S. Weirich, and K. Crary. Safe and flexible dynamic linking of native code. In R. Harper, editor, Workshop on Types in Compilation, volume 2071 of Lecture Notes in Computer Science, pages 147--176. Springer-Verlag, 2000.
    [13]
    G. Huet. Résolution d'équations dans des langages d'ordre 1,2,..., ω. PhD thesis, Université Paris 7, 1976.
    [14]
    A. J. Kennedy. Pickler combinators. Journal of Functional Programming, 14 (6): 727--739, 2004.
    [15]
    X. Leroy. Efficient data representation in polymorphic languages. In PLILP'90: 2nd International Workshop on Programming Language Implementation and Logic Programming, volume 456 of Lecture Notes in Computer Science, pages 255--276. Springer, Aug. 1990.
    [16]
    X. Leroy and M. Mauny. Dynamics in ML. Journal of Functional Programming, 3 (4): 431--463, 1993.
    [17]
    X. Leroy, D. Doligez, J. Garrigue, D. Rémy, and J. Vouillon. The Objective Caml system release 3.12, June 2010.
    [18]
    A. Mycroft. Polymorphic type schemes and recursive definitions. In ISP'84: Proceedings of the 6th International Symposium on Programming, volume 167 of Lecture Notes in Computer Science, pages 217--228. Springer, 1984.
    [19]
    G. Plotkin. A note on inductive generalization. Machine Intelligence, 5: 153--163, 1970.
    [20]
    F. Pottier and D. Rémy. The Essence of ML Type Inference. In B. C. Pierce, editor, Advanced Topics in Types and Programming Languages, chapter 10, pages 389--489. MIT Press, 2005.
    [21]
    H. Sutou and E. Sumii. Quicksilver/OCaml: A poor man's type-safe and abstraction-secure communication library. Unpublished, 2007.
    [22]
    S. Tobin-Hochstadt and M. Felleisen. The design and implementation of Typed Scheme. In POPL'08: Proceedings of the 35th ACM Symposium on Principles of Programming Languages, pages 395--406, Jan. 2008.
    [23]
    A. P. Tolmach. Tag-free garbage collection using explicit type parameters. In LFP '94: Proceedings of the 1994 ACM Conference on LISP and Functional ProgrammingcitetLFP:94, pages 1--11.
    [24]
    S. Weirich. Higher-order intensional type analysis. In ESOP'02: Proceedings of the 11th European Symposium on Programming, pages 98--114, 2002.
    [25]
    S. Weirich. Type-safe run-time polytypic programming. Journal of Functional Programming, 16 (10): 681--710, Nov. 2006.
    [26]
    J. Yallop. Practical generic programming in OCaml. In ML'07: Proceedings of the ACM Workshop on ML, pages 83--94, Sept. 2007.

    Cited By

    View all
    • (2020)Verifying object constructionProceedings of the ACM/IEEE 42nd International Conference on Software Engineering10.1145/3377811.3380341(1447-1458)Online publication date: 27-Jun-2020
    • (2018)Generic Programming in OCamlElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.285.3285(59-100)Online publication date: 31-Dec-2018
    • (2016)A Type Safe Access to Key-value Stores from Functional LanguagesJournal of Information Processing10.2197/ipsjjip.24.14124:1(141-151)Online publication date: 2016
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ICFP '12: Proceedings of the 17th ACM SIGPLAN international conference on Functional programming
    September 2012
    392 pages
    ISBN:9781450310543
    DOI:10.1145/2364527
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 47, Issue 9
      ICFP '12
      September 2012
      368 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2398856
      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: 09 September 2012

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. ocaml
    2. type-safe marshalling

    Qualifiers

    • Research-article

    Conference

    ICFP'12
    Sponsor:

    Acceptance Rates

    ICFP '12 Paper Acceptance Rate 32 of 88 submissions, 36%;
    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)2
    • Downloads (Last 6 weeks)0

    Other Metrics

    Citations

    Cited By

    View all
    • (2020)Verifying object constructionProceedings of the ACM/IEEE 42nd International Conference on Software Engineering10.1145/3377811.3380341(1447-1458)Online publication date: 27-Jun-2020
    • (2018)Generic Programming in OCamlElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.285.3285(59-100)Online publication date: 31-Dec-2018
    • (2016)A Type Safe Access to Key-value Stores from Functional LanguagesJournal of Information Processing10.2197/ipsjjip.24.14124:1(141-151)Online publication date: 2016
    • (2017)Scaling up functional programming education: under the hood of the OCaml MOOCProceedings of the ACM on Programming Languages10.1145/31102481:ICFP(1-25)Online publication date: 29-Aug-2017

    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