Existing minimal Object-Oriented models (OO), like Featherweight Java (FJ), are valuable for modelling programs and designing new programming languages and tools. However, their utility in developing real-world programs is limited. We introduce the 'Fearless Heart', a novel object calculus preserving FJ's minimal and extensible nature while being more suited for constructing complex, real-world applications. To illustrate the extensibility of the Fearless Heart, we extend it with Reference Capabilities (RC), creating R-Fearless. It supports mutability and other side effects while retaining the reasoning advantages of functional programming and gaining support for features that are well-known to be enabled by RC, like automatic parallelism, caching and invariants. R-Fearless is still minimal enough to allow further extensions. It is an ideal foundation for constructing both practical systems and formal models.
翻译:现有最小化面向对象模型(如轻量级Java,FJ)在程序建模以及新编程语言和工具的设计中具有重要价值,但其在开发实际程序方面的应用有限。我们提出"无畏之心"(Fearless Heart),一种新型对象演算,它保留了FJ的最小化和可扩展特性,同时更适用于构建复杂的实际应用。为展示无畏之心的可扩展性,我们引入引用能力(Reference Capabilities,RC)对其进行扩展,创建了R-Fearless。该模型支持可变性及其他副作用,同时保留函数式编程的推理优势,并支持引用能力所启用的知名特性(如自动并行、缓存和不变量)。R-Fearless仍保持足够的最小化,以支持进一步扩展,是构建实用系统与形式模型的理想基础。