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.
Supplemental Material
- Val Breazu-Tannen, Thierry Coquand, Carl A. Gunter, and Andre Scedrov. 1991. Inheritance as Implicit Coercion. Information and Computation 93 (1991), 172–221. Google Scholar
Digital Library
- Karl Crary. 2017. Modules, Abstraction, and Parametric Polymorphism. In Forty-Fourth ACM Symposium on Principles of Programming Languages. Paris, France. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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.Google Scholar
Cross Ref
- Derek Dreyer. 2005. Understanding and Evolving the ML Module System. Ph.D. Dissertation. Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- Martin Elsman. 1999. Static Interpretation of Modules. In 1999 ACM International Conference on Functional Programming. Paris, France, 208–219. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- Robert Harper, David MacQueen, and Robin Milner. 1986. Standard ML. Technical Report ECS-LFCS-86-2. Department of Computer Science, University of Edinburgh.Google Scholar
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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.Google Scholar
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- Xavier Leroy. 1994. Manifest Types, Modules and Separate Compilation. In Twenty-First ACM Symposium on Principles of Programming Languages. Portland, Oregon, 109–122. Google Scholar
Digital Library
- Xavier Leroy. 1995. Applicative Functors and Fully Transparent Higher-Order Modules. In Twenty-Second ACM Symposium on Principles of Programming Languages. San Francisco. Google Scholar
Digital Library
- 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 .Google Scholar
- 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).Google Scholar
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- Robin Milner, Mads Tofte, and Robert Harper. 1990. The Definition of Standard ML. The MIT Press, Cambridge, Massachusetts. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- Marco Patrignani, Amal Ahmed, and Dave Clarke. 2019. Formal Approaches to Secure Compilation. Comput. Surveys (2019). To appear.Google Scholar
- 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.Google Scholar
- Andreas Rossberg, Claudio Russo, and Derek Dreyer. 2014. F-ing Modules. Journal of Functional Programming 24, 5 (Sept. 2014).Google Scholar
Cross Ref
- Claudio V. Russo. 1998. Types for Modules. Ph.D. Dissertation. Edinburgh University.Google Scholar
- Claudio V. Russo. 2000. First-Class Structures for Standard ML. Nordic Journal of Computing 7, 4 (2000). Google Scholar
Digital Library
- Claudio V. Russo. 2001. Recursive Structures for Standard ML. In 2001 ACM International Conference on Functional Programming. Google Scholar
Digital Library
- Chung-chieh Shan. 2006. Higher-order modules in System F ω and Haskell. (May 2006). Available at homes.soic.indiana. edu/ccshan/xlate/xlate.pdf .Google Scholar
- Zhong Shao. 1998. Typed Cross-Module Compilation. In 1998 ACM International Conference on Functional Programming. Baltimore, Maryland, 141–152. Google Scholar
Digital Library
- Zhong Shao. 1999. Transparent Modules with Fully Syntactic Signatures. In 1999 ACM International Conference on Functional Programming. Paris, 220–232. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
Index Terms
Fully abstract module compilation
Recommendations
Fully-abstract compilation by approximate back-translation
POPL '16A compiler is fully-abstract if the compilation from source language programs to target language programs reflects and preserves behavioural equivalence. Such compilers have important security benefits, as they limit the power of an attacker ...
Fully-abstract compilation by approximate back-translation
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesA compiler is fully-abstract if the compilation from source language programs to target language programs reflects and preserves behavioural equivalence. Such compilers have important security benefits, as they limit the power of an attacker ...
Fully abstract semantics of additive aspects by translation
AOSD '07: Proceedings of the 6th international conference on Aspect-oriented software developmentWe study the denotational semantics of an aspect calculus by compositional translation to a functional language with higher-order store and ML-style references. The calculus is designed to construct only "additive" aspects i.e. those that do not elide ...






Comments