首页> 外文会议>ACM SIGPLAN-SIGACT symposium on Principles of programming languages >A type-theoretic approach to higher-order modules with sharing
【24h】

A type-theoretic approach to higher-order modules with sharing

机译:基于类型理论的高阶模块共享方法

获取原文

摘要

The design of a module system for constructing and maintaining large programs is a difficult task that raises a number of theoretical and practical issues. A fundamental issue is the management of the flow of information between program units at compile time via the notion of an interface. Experience has shown that fully opaque interfaces are awkward to use in practice since too much information is hidden, and that fully transparent interfaces lead to excessive interdependencies, creating problems for maintenance and separate compilation. The "sharing" specifications of Standard ML address this issue by allowing the programmer to specify equational relationships between types in separated modules, but are not expressive enough to allow the programmer complete control over the propagation of type information between modules.

These problems are addressed from a type-theoretic viewpoint by considering a calculus based on Girard's system Fω. The calculus differs formthose considered in previous studies by relying exclusively on a new form of weak sum type to propagate information at compile-time, in contrast to approaches based on strong sums which rely on substitution. The new form of sum type allows for the specification of equational, as well as type and kind, information in interfaces. This provides complete control over the propagation of compile-time information between program units and is sufficient to encode in a straightforward way most users of type sharing specifications in Standard ML. Modules are treated as "first-class" citizens, and therefore the system supports higher-order modules and some object-oriented programming idioms; the language may be easily restricted to "second-class" modules found in ML-like languages.

机译:

设计用于构建和维护大型程序的模块系统是一项艰巨的任务,它引发了许多理论和实践问题。一个基本问题是在编译时通过接口的概念来管理程序单元之间的信息流。经验表明,由于隐藏了太多信息,完全不透明的接口在实践中很难使用,并且完全透明的接口会导致过多的相互依赖关系,从而给维护和单独编译带来麻烦。标准ML的“共享”规范通过允许程序员在分离的模块中指定类型之间的方程式关系解决了此问题,但其表达方式不足以允许程序员完全控制模块之间的类型信息的传播。

从类型理论的角度出发,通过考虑基于吉拉德系统F ω的演算来解决这些问题。演算与先前研究中所考虑的形式不同,它完全依赖于新形式的弱和类型在编译时传播信息,这与基于强和的替代方法相反。总和类型的新形式允许在接口中指定方程式以及类型和种类的信息。这样就可以完全控制程序单元之间编译时信息的传播,并且足以以直截了当的方式对大多数标准ML类型共享规范的用户进行编码。模块被视为“一等”公民,因此系统支持高阶模块和一些面向对象的编程习惯。该语言可能很容易被限制为类似ML的语言中的“第二类”模块。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号