Live functional programming with typed holes
Live functional programming with typed holes
复制标题
带类型孔的实时函数式编程
DOI:
10.1145/3290327
复制
发表时间:
2019
影响因子:
--
通讯作者:
Hammer, Matthew A.
中科院分区:
文献类型:
--
作者:
Omar, Cyrus;Voysey, Ian;Chugh, Ravi;Hammer, Matthew A.
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.
登录
查看更多内容
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
影响因子:
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
DOI:
--
发表时间:
2005
期刊:
Processes, Terms and Cycles
影响因子:
--
作者:
Tomasz Blanc;J. Lévy;Luc Maranget
通讯作者:
Luc Maranget