arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 0908.3650cs.PL
收藏

懒惰的mixin模块和有纪律的效果

Lazy mixin modules and disciplined effects

Keiko Nakata

摘要:

期望程序设计语言支持程序员努力构造程序代码。ML模块系统,对象系统和mixin是促进模块化编程的语言结构的很好例子。在这三者中,mixin可以被认为是其他两个的泛化,因为mixin可以将ML模块和对象的特性与一组具有干净语义的原语运算符结合起来。许多工作致力于为实用的程序设计语言构建基于mixin的模块系统。在操作语义方面,以前的工作主要研究了按名称调用和按值调用计算设置中的混入演算。在本文中,我们将在按需调用或惰性评估设置中研究mixin演算。我们用一系列的例子来说明惰性混入在实践中是如何有趣的,并通过采用Ancona和Zucca对按名称调用混入的简洁形式化来形式化操作语义。然后,我们扩展的语义约束控制组件的混合在几种方式的评估顺序。考虑约束的主要动机是以一种比纯粹懒惰的需求驱动设置更明确的顺序产生副作用。我们探索可能有趣的约束的设计空间,并详细考虑两个例子。

英文摘要:

Programming languages are expected to support programmer's effort to structure program code. The ML module system, object systems and mixins are good examples of language constructs promoting modular programming. Among the three, mixins can be thought of as a generalization of the two others in the sense that mixins can incorporate features of ML modules and objects with a set of primitive operators with clean semantics. Much work has been devoted to build mixin-based module systems for practical programming languages. In respect of the operational semantics, previous work notably investigated mixin calculi in call-by-name and call-by-value evaluation settings. In this paper we examine a mixin calculus in a call-by-need, or lazy, evaluation setting. We demonstrate how lazy mixins can be interesting in practice with a series of examples, and formalize the operational semantics by adapting Ancona and Zucca's concise formalization of call-by-name mixins. We then extend the semantics with constraints to control the evaluation order of components of mixins in several ways. The main motivation for considering the constraints is to produce side effects in a more explicit order than in a purely lazy, demand-driven setting. We explore the design space of possibly interesting constraints and consider two examples in detail.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑