一句话:提出 Timeline,为电子表格引入离散时间维度,并用 dataflow、coeffect 等 PL 技术支持时间计算与有界内存。
电子表格擅长表达二维数据计算,却难以支持物理模拟、agent-based 模型、金融时序分析和交互系统等含时间的丰富计算。Timeline 为电子表格加入离散时间维度,并复用多种编程语言思想:用 dataflow 表达时间计算,用 coeffect 系统保证有界内存,用函数式响应式编程支持交互,用图形语法支持可组合可视化,并在公式编辑器中使用 typed holes 插入单元格引用。论文概述 Timeline 设计,通过核心演算形式化离散时间电子表格求值,提出基于 coeffect 的静态分析以确定所需过去值数量,并证明相应优化可靠,表明成熟的编程语言思想常可迁移到原领域之外。
Spreadsheets make it easy to express computations over two-dimensional data, but two dimensions are not enough to express rich computations with time such as physics simulations, agent-based models, analyses of financial data, or interactive systems. We present Timeline, a system that adds discrete time to spreadsheets. The remarkable insight from our work is that a large number of advanced programming language concepts can be directly applied in the context of spreadsheets with time. Timeline draws from dataflow languages to express computations over time, coeffect systems to ensure bounded memory usage, functional reactive programming to support interactivity, grammars of graphics to support composable visualizations, and typed holes for inserting cell references in the formula editor. In this paper, we provide an overview of the Timeline design and discuss how it adapts the aforementioned programming language innovations for the context of spreadsheets. We formalize the evaluation of spreadsheets with discrete time through a core calculus, describe a coeffect-based static analysis that determines the required number of past values and prove that the optimization is sound. More broadly, this paper shows that established programming language ideas can often be productively used outside of their original domain.