F-ing modules

Author:

ROSSBERG ANDREAS,RUSSO CLAUDIO,DREYER DEREK

Abstract

AbstractML modules are a powerful language mechanism for decomposing programs into reusable components. Unfortunately, they also have a reputation for being “complex” and requiring fancy type theory that is mostly opaque to non-experts. While this reputation is certainly understandable, given the many non-standard methodologies that have been developed in the process of studying modules, we aim here to demonstrate that it is undeserved. To do so, we present a novel formalization of ML modules, which defines their semantics directly by a compositional “elaboration” translation into plain System Fω (the higher-order polymorphic λ-calculus). To demonstrate the scalability of our “F-ing” semantics, we use it to define a representative, higher-order ML-style module language, encompassing all the major features of existing ML module dialects (except for recursive modules). We thereby show that ML modules are merely a particular mode of use of System Fω.To streamline the exposition, we present the semantics of our module language in stages. We begin by defining a subset of the language supporting a Standard ML-like language with second-class modules and generative functors. We then extend this sublanguage with the ability to package modules as first-class values (a very simple extension, as it turns out) and OCaml-style applicative functors (somewhat harder). Unlike previous work combining both generative and applicative functors, we do not require two distinct forms of functor or signature sealing. Instead, whether a functor is applicative or not depends only on the computational purity of its body. In fact, we argue that applicative/generative is rather incidental terminology for pure versus impure functors. This approach results in a semantics that we feel is simpler and more natural than previous accounts, and moreover prohibits breaches of abstraction safety that were possible under them.

Publisher

Cambridge University Press (CUP)

Subject

Software

Reference59 articles.

1. Torgersen M. , Ernst E. & Hanser C. P. (2005) Wild FJ. In International Workshop on Foundations of Object-Oriented Languages, 1–15.

2. Sulzmann M. , Chakravarty M. M. T. , Peyton Jones S. & Donnelly K. (2007) System F with type equality coercions. In ACM SIGPLAN Workshop on Types in Language Design and Implementation, 53–66.

3. SML/NJ Development Team (1993) Standard ML of New Jersey user's guide. 0.93 ed., AT&T Bell Laboratories.

4. Shields M. & Peyton Jones S. (2002) First-class modules for Haskell. In International Workshop on Foundations of Object-Oriented Language, pp. 28–40.

5. Shao Z. (1999) Transparent modules with fully syntactic signatures. In ACM SIGPLAN International Conference on Functional Programming, 220–232.

Cited by 32 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Staged Compilation with Module Functors;Proceedings of the ACM on Programming Languages;2024-08-15

2. A Logical Approach to Type Soundness;Journal of the ACM;2024-07-10

3. Fulfilling OCaml Modules with Transparency;Proceedings of the ACM on Programming Languages;2024-04-29

4. An ML-Style Module System for Cross-Stage Type Abstraction in Multi-stage Programming;Lecture Notes in Computer Science;2024

5. Modularity, Code Specialization, and Zero-Cost Abstractions for Program Verification;Proceedings of the ACM on Programming Languages;2023-08-30

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3