Live functional programming with typed holes

Live functional programming with typed holes
复制标题

带类型孔的实时函数式编程

DOI:
10.1145/3290327
复制
发表时间:
2019
影响因子:
--
通讯作者:
Hammer, Matthew A.
Hammer, Matthew A.
中科院分区:
--
文献类型:
--
作者:
Omar, Cyrus;Voysey, Ian;Chugh, Ravi;Hammer, Matthew A.

文献摘要

参考文献

被引文献

相似文献

实时编程环境旨在为程序员(有时是观众)提供有关程序在编辑时的动态行为的持续反馈。问题是编程语言通常只将动态含义分配给完整的程序,即语法结构良好且没有类型错误的程序。因此,现场反馈给程序员表现出时间或感知gaps.This面临这个“差距问题”从类型理论的第一原则,开发一个动态语义不完整的功能程序,从静态语义不完整的功能程序开发在最近的工作榛子。我们将不完整的函数程序建模为带孔的表达式,空的孔代表缺失的表达式或类型,非空的孔作为静态和动态类型不一致的膜。而不是像在一些现有系统中那样在评估遇到任何这些孔时中止,评估围绕孔进行,当它流过程序的其余部分时跟踪每个孔实例周围的闭合。编辑器服务可以使用这些漏洞闭合中的信息来帮助程序员在决定如何填充剩余的漏洞时开发和确认程序的完整部分的行为的心理模型。孔洞闭合还支持填充并恢复操作,从而避免了在相当于孔洞填充的编辑之后重新开始计算的需要。形式上,语义学借用了渐进类型理论(为处理未填充的类型漏洞提供了基础)和上下文模态类型理论(为漏洞闭合提供了逻辑基础)的机制,将这些机制结合起来,并开发了必要的额外机制来继续评估过去的漏洞,同时保持类型安全。我们已经使用Agda证明助手将核心演算的元理论机械化,称为Hazelnut Live。我们还将这些想法实现到Hazel编程环境中。该实现遵循Hazelnut编辑操作演算自动插入漏洞,以保证每个编辑器状态都有一些(可能不完整)类型。结合本文的类型安全属性,其结果是一个概念验证的实时编程环境,其中丰富的动态反馈是真正可用的,没有差距,即每一个可达的编辑器状态。
Live programming environments aim to provide programmers (and sometimes audiences) with continuous feedback about a program's dynamic behavior as it is being edited. The problem is that programming languages typically assign dynamic meaning only to programs that are complete, i.e. syntactically well-formed and free of type errors. Consequently, live feedback presented to the programmer exhibits temporal or perceptive gaps.This paper confronts this "gap problem" from type-theoretic first principles by developing a dynamic semantics for incomplete functional programs, starting from the static semantics for incomplete functional programs developed in recent work on Hazelnut. We model incomplete functional programs as expressions with holes, with empty holes standing for missing expressions or types, and non-empty holes operating as membranes around static and dynamic type inconsistencies. Rather than aborting when evaluation encounters any of these holes as in some existing systems, evaluation proceeds around holes, tracking the closure around each hole instance as it flows through the remainder of the program. Editor services can use the information in these hole closures to help the programmer develop and confirm their mental model of the behavior of the complete portions of the program as they decide how to fill the remaining holes. Hole closures also enable a fill-and-resume operation that avoids the need to restart evaluation after edits that amount to hole filling. Formally, the semantics borrows machinery from both gradual type theory (which supplies the basis for handling unfilled type holes) and contextual modal type theory (which supplies a logical basis for hole closures), combining these and developing additional machinery necessary to continue evaluation past holes while maintaining type safety. We have mechanized the metatheory of the core calculus, called Hazelnut Live, using the Agda proof assistant.We have also implemented these ideas into the Hazel programming environment. The implementation inserts holes automatically, following the Hazelnut edit action calculus, to guarantee that every editor state has some (possibly incomplete) type. Taken together with this paper's type safety property, the result is a proof-of-concept live programming environment where rich dynamic feedback is truly available without gaps, i.e. for every reachable editor state.
使用 Elm 向 K-8 学生介绍代数思维
DOI: --
发表时间: 2018
期刊: TFPIE@TFP
影响因子: --
作者:
Curtis D'Alves;Tanya Bouman;Christopher W. Schankula;J. Hogg;Levin Noronha;Emily Horsman;R. Siddiqui;Christopher Kumar Anand
通讯作者: Christopher Kumar Anand
谢尔洛克
DOI: --
发表时间: 2017
影响因子: 1.3
作者:
Danfeng Zhang;A. Myers;Dimitrios Vytiniotis;S. Jones
通讯作者: S. Jones
DOI: --
发表时间: 2012
期刊: DAC Design Automation Conference 2012
影响因子: --
作者:
M. Rinard
通讯作者: M. Rinard
可扩展的类型定向编辑
DOI: --
发表时间: 2018
期刊: TyDe@ICFP
影响因子: --
作者:
Joomy Korkut;D. Christiansen
通讯作者: D. Christiansen
弱 Lambda 演算中的共享
DOI: --
发表时间: 2005
期刊: Processes, Terms and Cycles
影响因子: --
作者:
Tomasz Blanc;J. Lévy;Luc Maranget
通讯作者: Luc Maranget