Just as the $λ$-calculus uses three primitives (abstraction, application, variable) as the foundation of functional programming, overlay-calculus uses three primitives (record, definition, inheritance) as the foundation of declarative programming. It trivially embeds the $λ$-calculus, although the entire semantics rests solely on naive set theory; as a consequence, all constructs including inheritance are inherently commutative, idempotent, and associative; the linearization problem of multiple inheritance does not arise. This induces a fully abstract semantics of the lazy $λ$-calculus with respect to Böhm tree equivalence~\cite{barendregt1984lambda}. Overlay-calculus is distilled from the Overlay language, a practical implementation in which we observed further emergent phenomena: the Expression Problem dissolves, programs are function color blind~\cite{nystrom2015color}, ordinary arithmetic yields the relational semantics of logic programming, and self-reference resolves to multiple targets, making overlay-calculus strictly more expressive than the $λ$-calculus in Felleisen's sense~\cite{felleisen1991expressive}. These properties suggest applications to configuration languages, dependency injection, object-oriented programming, composable effect systems, modular software architectures, file-system-as-compiler, general-purpose programming, and no-code development.
翻译:正如λ演算以三个基本要素(抽象、应用、变量)作为函数式编程的基础,覆盖演算以三个基本要素(记录、定义、继承)作为声明式编程的基础。它能够平凡地嵌入λ演算,尽管其整个语义完全建立在朴素集合论之上;因此,包括继承在内的所有构造本质上都具有交换性、幂等性和结合性;多重继承的线性化问题不会出现。这导出了关于Böhm树等价~\cite{barendregt1984lambda}的惰性λ演算的完全抽象语义。覆盖演算提炼自Overlay语言——一个实际实现,在其中我们观察到更多涌现现象:表达式问题消解,程序具有函数色盲特性~\cite{nystrom2015color},普通算术产生逻辑编程的关系语义,且自引用解析为多个目标,使得覆盖演算在Felleisen的意义上~\cite{felleisen1991expressive}严格比λ演算更具表达力。这些特性表明其在配置语言、依赖注入、面向对象编程、可组合效应系统、模块化软件架构、文件系统即编译器、通用编程以及无代码开发等领域具有应用潜力。