Live programming systems aim to quickly show programmers the dynamic impacts of program edits. To do so, they re-execute the program whenever it is edited, which poses a computational challenge when programs become large or complex. This has led to the need for incrementality in the implementation of live program interpreters. This paper introduces Chordata, an incremental program interpreter based on shortcut memoization, which learns repeated patterns of computation, called shortcuts, by observing executions of previous versions of a program. It can then apply these shortcuts when the same or a structurally similar program fragment is re-executed. This paper contributes a formal semantics of shortcut memoization for any language with a rewrite-based semantics, with mechanized proofs of key correctness properties. We then express a variant of the Hazel live programming system, expressed as a CEK machine, in Chordata, and develop a number of practical heuristics to learn high-value shortcuts. We evaluate the resulting system on editing traces of students solving simple programming problems. Chordata achieves a speedup of 13.03\times compared to baseline with a 19.97\times memory overhead. For smaller changes and for more complex programs, Chordata achieves even greater speedups. Furthermore, we show that Chordata is capable of providing a speedup even within a single execution, with a faster speedup on a larger input.


翻译:即时编程系统旨在快速向程序员展示代码编辑的动态影响。为此,每当程序被编辑时,系统会重新执行程序,这在程序规模变大或复杂度增加时带来了计算挑战。这促使即时编程解释器的实现需要具备增量性。本文提出Chordata——一种基于捷径记忆化技术的增量式程序解释器,它通过观察程序先前版本的执行过程,学习重复出现的计算模式(即捷径),并在相同或结构相似的程序片段被重新执行时应用这些捷径。本文为任何基于重写语义的语言贡献了捷径记忆化技术的形式化语义,并给出了关键正确性属性的机械化证明。随后,我们将Hazel即时编程系统的一个变体(以CEK机器形式表述)在Chordata中实现,并开发了多种实用启发式策略来学习高价值捷径。我们利用学生解决简单编程问题的编辑轨迹对所提出系统进行了评估。与基线相比,Chordata实现了13.03倍的加速比,同时带来19.97倍的内存开销。对于微小修改和更复杂的程序,Chordata甚至能获得更高加速比。此外,我们证明Chordata即使在单次执行中也能提供加速效果,且输入规模越大加速比越显著。

0
下载
关闭预览

相关内容

人们为了让计算机解决各种棘手的问题,使用编程语言 编写程序代码并通过计算机运算得到最终结果的过程。
【CVPR2024】生成式多模态模型是优秀的类增量学习器
专知会员服务
32+阅读 · 2024年3月28日
UIUC-Gargi《增强型语言模型》,64页ppt与视频
专知会员服务
37+阅读 · 2023年5月12日
《分布式多智能体强化学习的编码》加州大学等
专知会员服务
56+阅读 · 2022年11月2日
【SIGIR2021】基于嵌入的增量式时序知识图谱补全框架
专知会员服务
63+阅读 · 2021年4月21日
【翻译技术速递】入门教程:Trados 翻译记忆库工具
翻译技术沙龙
38+阅读 · 2019年11月28日
谷歌推出新型数据增强算法:AutoAugment
论智
20+阅读 · 2018年6月6日
超全总结:神经网络加速之量化模型 | 附带代码
【干货】深入理解自编码器(附代码实现)
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
14+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 4月28日
VIP会员
最新内容
ICML 2026 | 自回归Boltzmann生成器重塑分子采样
专知会员服务
0+阅读 · 53分钟前
GNN跨域综述:从消息传递到图基础模型
专知会员服务
0+阅读 · 55分钟前
无人机自主控制与人工智能:系统性综述
专知会员服务
11+阅读 · 今天7:25
巡飞弹与反无人机系统——现代战场的两大支柱
专知会员服务
3+阅读 · 今天6:54
《打造“黄金舰队”》57页报告
专知会员服务
3+阅读 · 今天6:52
《北约数字教官网络发展路径》128页报告
专知会员服务
2+阅读 · 今天6:33
ECCV 2026 | MIMFlow:MIM与归一化流统一图像生成
专知会员服务
7+阅读 · 6月25日
网状网络及其在军事领域的运用
专知会员服务
8+阅读 · 6月25日
无美国参与的欧洲战争方式(万字长文)
专知会员服务
8+阅读 · 6月25日
《国防领域敏感性分析白皮书》
专知会员服务
9+阅读 · 6月25日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
14+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员