时空可组合性的编程范式

A Programming Paradigm for Spatiotemporal Composability

深度求索 DeepSeek-AI · DeepSeek-AI · Peking University · 2026-07-01 · Paper ↗

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

本文介绍了一种时空可组合性的编程范式,以应对现代软件系统中动态组合的挑战。它确定了两个正交维度:时间可组合性,确保组件移除时其效果能够完全且安全地逆转;以及空间可组合性,管理组件间结构化的依赖解析。以 Visual Studio Code 为案例研究,作者展示了当前插件系统的局限性,其中动态卸载和扩展间依赖支持不足。他们提出了一个基于可逆效应和反应性共效应的形式化基础,统一为单一上下文类型,并提出了一个具有操作语义的动态组合演算。这些思想在 Cordis 中实现,这是一个提供效应跟踪、共效应解析和热模块替换的元框架。论文总结道,这一范式实现了细粒度、安全的动态组合,克服了粗粒度进程或容器重启的成本,并适用于自修改代理框架及其他动态架构。

This article introduces a programming paradigm for spatiotemporal composability, addressing the challenges of dynamic composition in modern software systems. It identifies two orthogonal dimensions: temporal composability, which ensures complete and safe reversal of a component's effects upon removal, and spatial composability, which manages structured dependency resolution among components. Using Visual Studio Code as a case study, the authors demonstrate limitations in current plugin systems, where dynamic unloading and inter-extension dependencies are poorly supported. They propose a formal foundation based on revertible effects and reactive coeffects, unified into a single context type, and present a calculus for dynamic composition with operational semantics. The ideas are implemented in Cordis, a meta-framework providing effect tracking, coeffect resolution, and hot module replacement. The paper concludes that this paradigm enables fine-grained, safe dynamic composition, overcoming the costs of coarse-grained process or container restarts, and is applicable to self-modifying agent harnesses and other dynamic architectures.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 61)

阅读逐段中英对照全文 →