Towards type inference for Java']JavaScript

被引:0
|
作者
Anderson, C
Giannini, P
Drossopoulou, S
机构
[1] Univ London Imperial Coll Sci Technol & Med, Dept Comp, London SW7 2BZ, England
[2] Univ Piemonte Orientale, Dipartimento Informat, Alessandria, Italy
关键词
D O I
暂无
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Object-oriented scripting languages like JavaScript and Python are popular partly because of their dynamic features. These include the runtime modification of objects and classes through addition of fields or updating, of methods. These features make static typing difficult and so usually dynamic typing is used. Consequently, errors such as access to non-existent members are not detected until runtime. We first develop a formalism for an object based language, JS(0), with features from JavaScript, including dynamic addition of fields and updating of methods. We give an operational semantics and static type system for JS(0) using structural types. Our types allow objects to evolve in a controlled manner by classifying members as definite or potential. We define a type inference algorithm for JS(0) that is sound with respect to the type system. If the type inference algorithm succeeds, then the program is typeable. Therefore, programmers can benefit from the safety offered by the type system, without the need to write explicitly types in their programs.
引用
收藏
页码:428 / 452
页数:25
相关论文
共 50 条
  • [31] Static Typing & Java']JavaScript Libraries: Towards a More Considerate Relationship
    Canou, Benjamin
    Chailloux, Emmanuel
    Botbol, Vincent
    PROCEEDINGS OF THE 22ND INTERNATIONAL CONFERENCE ON WORLD WIDE WEB (WWW'13 COMPANION), 2013, : 15 - 17
  • [32] Towards Fine-Grained Access Control in Java']JavaScript Contexts
    Patil, Kailas
    Dong, Xinshu
    Li, Xiaolei
    Liang, Zhenkai
    Jiang, Xuxian
    31ST INTERNATIONAL CONFERENCE ON DISTRIBUTED COMPUTING SYSTEMS (ICDCS 2011), 2011, : 720 - 729
  • [33] Java']JavaScript adventures
    Baldazo, R
    BYTE, 1996, 21 (08): : 117 - &
  • [34] Java']JavaScript fix
    Burge, MH
    DR DOBBS JOURNAL, 1996, 21 (08): : 12 - 12
  • [35] Java']JavaScript cookies
    Tichenor, CB
    DR DOBBS JOURNAL, 1997, 22 (05): : 42 - 45
  • [36] Java']Javascript complete
    DeLoach, S
    TECHNICAL COMMUNICATION, 1999, 46 (03) : 400 - 403
  • [37] Java']JavaScript fix
    McKenzie, N
    DR DOBBS JOURNAL, 2001, 26 (10): : 10 - 10
  • [38] Java']JavaScript revisited
    Udell, J
    BYTE, 1997, 22 (05): : 99 - &
  • [39] Java']JavaScript ROOT
    Bellenot, Bertrand
    Linev, Sergey
    21ST INTERNATIONAL CONFERENCE ON COMPUTING IN HIGH ENERGY AND NUCLEAR PHYSICS (CHEP2015), PARTS 1-9, 2015, 664
  • [40] Adventures in Java']JavaScript
    Moncur, M
    BYTE, 1996, 21 (12): : 20 - 20