\emph{Literate programming}, introduced by Knurth, interleaves code and prose so that a program can be read as both executable and explanatory text. We propose \emph{literate execution}, which inverts this relationship: rather than embedding code within a static narrative, we treat documentation -- and other expository elements such as visualisations -- as first-class artefacts that can be computed alongside a running program and then integrated into a view of its execution. We explore this idea through Fluid, a programming language with a provenance-tracking runtime that records fine-grained dependencies between inputs and outputs. These provenance relationships can be surfaced as interactions that allow readers to explore how intermediate values contribute to a result. By integrating visualisation, provenance, and exposition, literate execution aims to make programs more explorable and self-explanatory, and explorable explanations easier to program.


翻译:Knuth提出的《文学编程》(Literate Programming)将代码与文档交织,使程序既可执行又具可读性。本文提出《代码可读执行》(Literate Execution),通过反转这一关系:不再将代码嵌入静态叙事,而是将文档——以及可视化等其他展示元素——视为可与运行程序协同计算的第一类制品,并将其整合至执行视图中。我们通过Fluid语言验证该理念,该语言运行时系统通过溯源追踪记录输入与输出间的细粒度依赖关系。这种溯源关联可转化为交互式呈现,使读者能探索中间变量如何影响最终结果。通过融合可视化、溯源机制与展示说明,代码可读执行旨在构建更可探索、自解释的程序,并降低可探索式解释的编程复杂度。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【2023新书】程序证明,Program Proofs,642页pdf
专知会员服务
67+阅读 · 2023年3月29日
【书籍推荐】简洁的Python编程(Clean Python),附274页pdf
专知会员服务
184+阅读 · 2020年1月1日
强化学习与文本生成
微信AI
41+阅读 · 2019年4月4日
可能是 Android 上最好用的写作 App
少数派
11+阅读 · 2018年12月21日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
VIP会员
最新内容
驱动军事决策变革的顶尖人工智能指挥系统
专知会员服务
2+阅读 · 今天13:50
非对称防御中的自组织临界性:俄乌战争
专知会员服务
8+阅读 · 8月10日
《战争中的大语言模型监管》
专知会员服务
10+阅读 · 8月10日
《边缘计算关键技术分析及美军作战实践应用》
边缘计算的军事应用
专知会员服务
11+阅读 · 8月9日
一种考虑资源机动性的武器目标分配混合算法
专知会员服务
12+阅读 · 8月8日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员