Typing and semantics of asynchronous arrows in Java']JavaScript

被引:0
|
作者
Fritz, Eric [1 ]
Zhao, Tian [1 ]
机构
[1] Univ Wisconsin, Milwaukee, WI 53201 USA
关键词
!text type='Java']Java[!/text]Script; Asynchronous programming; Type inference; Type checking; Semantics;
D O I
10.1016/j.scico.2017.03.003
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Asynchronous programs in JavaScript using callbacks and promises are difficult to write correctly. Many programs have subtle errors due to the unwanted interaction of event handlers. To fix such errors, the programmer is burdened with explicit registration and de-registration of event handlers. This produces fragile code which is difficult to read and maintain. Arrows, a generalization of monads, are an elegant solution to asynchronous program composition. In this paper, we present the semantics of an arrow-based DSL in JavaScript which can encode asynchronous programs as a state machine where edge transitions are triggered by external events. To ensure that arrows are composed correctly, we provide an optional type checker that reports errors before the machine begins execution. (C) 2017 Elsevier B.V. All rights reserved.
引用
收藏
页码:1 / 39
页数:39
相关论文
共 50 条
  • [31] Java']JavaScript.
    Gillespie, T
    [J]. LIBRARY JOURNAL, 2000, 125 (13) : 146 - 146
  • [32] The Essence of Java']JavaScript
    Guha, Arjun
    Saftoiu, Claudiu
    Krishnamurthi, Shriram
    [J]. ECOOP 2010: OBJECT-ORIENTED PROGRAMMING, 2010, 6183 : 126 - 150
  • [33] The Java']JavaScript Ecosystem
    Frankston, Bob
    [J]. IEEE CONSUMER ELECTRONICS MAGAZINE, 2020, 9 (06) : 84 - 89
  • [34] Java']Javanni: A Verifier for Java']JavaScript
    Nordio, Martin
    Calcagno, Cristiano
    Furia, Carlo Alberto
    [J]. FUNDAMENTAL APPROACHES TO SOFTWARE ENGINEERING, FASE 2013, 2013, 7793 : 231 - 234
  • [35] Reasoning with diagrams: The semantics of arrows
    Ligozat, G
    [J]. MULTIPLE APPROACHES TO INTELLIGENT SYSTEMS, PROCEEDINGS, 1999, 1611 : 236 - 245
  • [36] Java与Javascript
    张光业
    [J]. 微电脑世界, 1996, (11) : 62 - 65
  • [37] Java']JavaScript cookies
    Tichenor, CB
    [J]. DR DOBBS JOURNAL, 1997, 22 (05): : 42 - 45
  • [38] Java']JavaScript adventures
    Baldazo, R
    [J]. BYTE, 1996, 21 (08): : 117 - &
  • [39] Java和JavaScript
    韩立
    王明哲
    [J]. 成功(教育), 2009, (01) : 177 - 177
  • [40] Java']JavaScript fix
    Burge, MH
    [J]. DR DOBBS JOURNAL, 1996, 21 (08): : 12 - 12