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 条
  • [1] Semantics of Asynchronous Java']JavaScript
    Loring, Matthew C.
    Marron, Mark
    Leijen, Daan
    [J]. ACM SIGPLAN NOTICES, 2017, 52 (11) : 51 - 62
  • [2] Directing Java']JavaScript with Arrows
    Phang, Khoo Yit
    Hicks, Michael
    Foster, Jeffrey S.
    Sazawal, Vibha
    [J]. ACM SIGPLAN NOTICES, 2009, 44 (12) : 49 - 58
  • [3] An Operational Semantics for Java']JavaScript
    Maffeis, Sergio
    Mitchell, John C.
    Taly, Ankur
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2008, 5356 : 307 - +
  • [4] Semantics and Analyses for Java']JavaScript and the Web
    Krishnamurthi, Shriram
    [J]. STATIC ANALYSIS, SAS 2012, 2012, 7460 : 4 - 4
  • [5] Ajax: Asynchronous Java']JavaScript and XML
    Bruno, EJ
    [J]. DR DOBBS JOURNAL, 2006, 31 (02): : 32 - 35
  • [6] An Asynchronous Call Graph for Java']JavaScript
    Seifert, Dominik
    Wan, Michael
    Hsu, Jane
    Yeh, Benson
    [J]. 2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: SOFTWARE ENGINEERING IN PRACTICE (ICSE-SEIP 2022), 2022, : 29 - 30
  • [7] Gradual Typing Embedded Securely in Java']JavaScript
    Swamy, Nikhil
    Fournet, Cedric
    Rastogi, Aseem
    Bhargavan, Karthikeyan
    Chen, Juan
    Strub, Pierre-Yves
    Bierman, Gavin
    [J]. ACM SIGPLAN NOTICES, 2014, 49 (01) : 425 - 437
  • [8] A Tested Semantics for Getters, Setters, and Eval in Java']JavaScript
    Politz, Joe Gibbs
    Carroll, Matthew J.
    Lerner, Benjamin S.
    Pombrio, Justin
    Krishnamurthi, Shriram
    [J]. ACM SIGPLAN NOTICES, 2013, 48 (02) : 1 - 16
  • [9] AUGUR: Dynamic Taint Analysis for Asynchronous Java']JavaScript
    Aldrich, Mark W.
    Turcotte, Alexi
    Blanco, Matthew
    Tip, Frank
    [J]. PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,
  • [10] KJS']JS: A Complete Formal Semantics of Java']JavaScript
    Park, Daejun
    Stefanescu, Andrei
    Rosu, Grigore
    [J]. ACM SIGPLAN NOTICES, 2015, 50 (06) : 346 - 356