Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Fully abstract module compilation

Published: 02 January 2019 Publication History

Abstract

We give a translation suitable for compilation of modern module calculi supporting sealing, generativity, translucent signatures, applicative functors, higher-order functors and/or first-class modules. Ours is the first module-compilation translation with a dynamic correctness theorem. The theorem states that the translation produces target terms that are contextually equivalent to the source, in an appropriate sense. A corollary of the theorem is that the translation is fully abstract. Consequently, the translation preserves all abstraction present in the source. In passing, we also show that modules are a definitional extension of the underlying core language. All of our proofs are formalized in Coq.

Supplementary Material

WEBM File (a10-crary.webm)

References

[1]
Val Breazu-Tannen, Thierry Coquand, Carl A. Gunter, and Andre Scedrov. 1991. Inheritance as Implicit Coercion. Information and Computation 93 (1991), 172–221.
[2]
Karl Crary. 2017. Modules, Abstraction, and Parametric Polymorphism. In Forty-Fourth ACM Symposium on Principles of Programming Languages. Paris, France.
[3]
Karl Crary, Robert Harper, and Sidd Puri. 1999. What is a Recursive Module?. In 1999 SIGPLAN Conference on Programming Language Design and Implementation. Atlanta, 50–63.
[4]
Pierre-Louis Curien and Giorgio Ghelli. 1992. Coherence of Subsumption, Minimum Typing and Type-Checking in F ≤ . Mathematical Structures in Computer Science 2, 1 (1992), 55–91.
[5]
Derek Dreyer. 2005. Understanding and Evolving the ML Module System. Ph.D. Dissertation. Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania.
[6]
Derek Dreyer, Karl Crary, and Robert Harper. 2003. A Type System for Higher-Order Modules. In Thirtieth ACM Symposium on Principles of Programming Languages. New Orleans, Louisiana, 236–249.
[7]
Martin Elsman. 1999. Static Interpretation of Modules. In 1999 ACM International Conference on Functional Programming. Paris, France, 208–219.
[8]
Martin Elsman, Troels Henriksen, Danil Annenkov, and Cosmin E. Oancea. 2018. Static Interpretation of Higher-Order Modules in Futhark: Functional GP U Programming in the Large. In 2018 ACM International Conference on Functional Programming.
[9]
Robert Harper and Mark Lillibridge. 1994. A Type-Theoretic Approach to Higher-Order Modules with Sharing. In Twenty-First ACM Symposium on Principles of Programming Languages. Portland, Oregon, 123–137.
[10]
Robert Harper, David MacQueen, and Robin Milner. 1986. Standard ML. Technical Report ECS-LFCS-86-2. Department of Computer Science, University of Edinburgh.
[11]
Robert Harper and John C. Mitchell. 1993. On the Type Structure of Standard ML. ACM Transactions on Programming Languages and Systems 15, 2 (April 1993), 211–252.
[12]
Robert Harper, John C. Mitchell, and Eugenio Moggi. 1990. Higher-Order Modules and the Phase Distinction. In Seventeenth ACM Symposium on Principles of Programming Languages. San Francisco, 341–354.
[13]
Robert Harper and Greg Morrisett. 1995. Compiling Polymorphism Using Intensional Type Analysis. In Twenty-Second ACM Symposium on Principles of Programming Languages. San Francisco, 130–141.
[14]
Robert Harper and Benjamin C. Pierce. 2005. Design Considerations for ML-Style Module Systems. In Advanced Topics in Types and Programming Languages, Benjamin C. Pierce (Ed.). The MIT Press.
[15]
Robert Harper and Chris Stone. 2000. A Type-Theoretic Interpretation of Standard ML. In Proof, Language and Interaction: Essays in Honour of Robin Milner. The MIT Press. Extended version published as CMU technical report CMU-CS-97-147.
[16]
Daniel K. Lee, Karl Crary, and Robert Harper. 2007. Towards a Mechanized Metatheory of Standard ML. In Thirty-Fourth ACM Symposium on Principles of Programming Languages. Nice, France.
[17]
Xavier Leroy. 1994. Manifest Types, Modules and Separate Compilation. In Twenty-First ACM Symposium on Principles of Programming Languages. Portland, Oregon, 109–122.
[18]
Xavier Leroy. 1995. Applicative Functors and Fully Transparent Higher-Order Modules. In Twenty-Second ACM Symposium on Principles of Programming Languages. San Francisco.
[19]
Xavier Leroy. 2003. A proposal for recursive modules in Objective Caml. (2003). Available at http://caml.inria.fr/pub/papers/ xleroy- recursive_modules- 03.pdf .
[20]
Xavier Leroy, Damien Doligez, Jacques Garrigue, Didier Rémy, and Jérôme Vouillon. 2016. The OCaml system, release 4.03, Documentation and user’s manual. Institut National de Recherche en Informatique et Automatique (INRIA).
[21]
David MacQueen. 1986. Using Dependent Types to Express Modular Structure. In Thirteenth ACM Symposium on Principles of Programming Languages. St. Petersburg Beach, Florida, 277–286.
[22]
David B. MacQueen and Mads Tofte. 1994. A Semantics for Higher-order Functors. In Fifth European Symposium on Programming (Lecture Notes in Computer Science), Vol. 788. Springer, 409–423.
[23]
Robin Milner, Mads Tofte, and Robert Harper. 1990. The Definition of Standard ML. The MIT Press, Cambridge, Massachusetts.
[24]
John C. Mitchell and Gordon D. Plotkin. 1988. Abstract Types Have Existential Type. ACM Transactions on Programming Languages and Systems 10, 3 (July 1988), 470–502.
[25]
Marco Patrignani, Amal Ahmed, and Dave Clarke. 2019. Formal Approaches to Secure Compilation. Comput. Surveys (2019). To appear.
[26]
Andrew Pitts. 2005. Typed Operational Reasoning. In Advanced Topics in Types and Programming Languages, Benjamin C. Pierce (Ed.). The MIT Press, Chapter 7, 245–289.
[27]
Andreas Rossberg, Claudio Russo, and Derek Dreyer. 2014. F-ing Modules. Journal of Functional Programming 24, 5 (Sept. 2014).
[28]
Claudio V. Russo. 1998. Types for Modules. Ph.D. Dissertation. Edinburgh University.
[29]
Claudio V. Russo. 2000. First-Class Structures for Standard ML. Nordic Journal of Computing 7, 4 (2000).
[30]
Claudio V. Russo. 2001. Recursive Structures for Standard ML. In 2001 ACM International Conference on Functional Programming.
[31]
Chung-chieh Shan. 2006. Higher-order modules in System F ω and Haskell. (May 2006). Available at homes.soic.indiana. edu/ccshan/xlate/xlate.pdf .
[32]
Zhong Shao. 1998. Typed Cross-Module Compilation. In 1998 ACM International Conference on Functional Programming. Baltimore, Maryland, 141–152.
[33]
Zhong Shao. 1999. Transparent Modules with Fully Syntactic Signatures. In 1999 ACM International Conference on Functional Programming. Paris, 220–232.
[34]
Christopher A. Stone and Robert Harper. 2000. Deciding Type Equivalence in a Language with Singleton Kinds. In TwentySeventh ACM Symposium on Principles of Programming Languages. Boston. Extended version published as CMU technical report CMU-CS-99-155.
[35]
Christopher A. Stone and Robert Harper. 2006. Extensional Equivalence and Singleton Types. ACM Transactions on Computational Logic 7, 4 (Oct. 2006). An earlier version appeared in the 2000 Symposium on Principles of Programming Languages.

Cited By

View all
  • (2025)Algebraic Stepper for Simple ModulesProceedings of the 2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3704253.3706137(13-29)Online publication date: 10-Jan-2025
  • (2024)Fulfilling OCaml Modules with TransparencyProceedings of the ACM on Programming Languages10.1145/36498188:OOPSLA1(194-222)Online publication date: 29-Apr-2024
  • (2024)An ML-Style Module System for Cross-Stage Type Abstraction in Multi-stage ProgrammingFunctional and Logic Programming10.1007/978-981-97-2300-3_13(237-272)Online publication date: 15-May-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 3, Issue POPL
January 2019
2275 pages
EISSN:2475-1421
DOI:10.1145/3302515
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]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 02 January 2019
Published in PACMPL Volume 3, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Modules
  2. full abstraction
  3. phase separation

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)104
  • Downloads (Last 6 weeks)23
Reflects downloads up to 24 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Algebraic Stepper for Simple ModulesProceedings of the 2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3704253.3706137(13-29)Online publication date: 10-Jan-2025
  • (2024)Fulfilling OCaml Modules with TransparencyProceedings of the ACM on Programming Languages10.1145/36498188:OOPSLA1(194-222)Online publication date: 29-Apr-2024
  • (2024)An ML-Style Module System for Cross-Stage Type Abstraction in Multi-stage ProgrammingFunctional and Logic Programming10.1007/978-981-97-2300-3_13(237-272)Online publication date: 15-May-2024
  • (2020)A focused solution to the avoidance problemJournal of Functional Programming10.1017/S095679682000022230Online publication date: 6-Aug-2020

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media