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 条
  • [1] Type Inference for Static Compilation of Java']JavaScript
    Chandra, Satish
    Gordon, Colin S.
    Jeannin, Jean-Baptiste
    Schlesinger, Cole
    Sridharan, Manu
    Tip, Frank
    Choi, Youngil
    ACM SIGPLAN NOTICES, 2016, 51 (10) : 410 - 429
  • [2] Fast and Precise Hybrid Type Inference for Java']JavaScript
    Hackett, Brian
    Guo, Shu-yu
    ACM SIGPLAN NOTICES, 2012, 47 (06) : 239 - 249
  • [3] Towards a type system for analyzing Java']JavaScript programs
    Thiemann, P
    PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2005, 3444 : 408 - 422
  • [4] Determining Dynamic Coupling in Java']JavaScript Using Object Type Inference
    Nicolay, Jens
    Noguera, Carlos
    De Roover, Coen
    De Meuter, Wolfgang
    2013 IEEE 13TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM), 2013, : 126 - 135
  • [5] Type Analysis for Java']JavaScript
    Jensen, Simon Holm
    Moller, Anders
    Thiemann, Peter
    STATIC ANALYSIS, 2009, 5673 : 238 - +
  • [6] Towards Specializing Java']JavaScript Programs
    Thiemann, Peter
    PERSPECTIVES OF SYSTEM INFORMATICS, PSI 2014, 2015, 8974 : 320 - 334
  • [7] Type Checking for Java']JavaScript
    Anderson, Christopher
    Giannini, Paola
    ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2005, 138 (02) : 37 - 58
  • [8] Towards a Program Logic for Java']JavaScript
    Gardner, Philippa
    Maffeis, Sergio
    Smith, Gareth
    POPL 12: PROCEEDINGS OF THE 39TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2012, : 31 - 44
  • [9] Towards a Program Logic for Java']JavaScript
    Gardner, Philippa
    Maffeis, Sergio
    Smith, Gareth
    ACM SIGPLAN NOTICES, 2012, 47 (01) : 31 - 44
  • [10] Guess What: Test Case Generation for Java']Javascript with Unsupervised Probabilistic Type Inference
    Stallenberg, Dimitri
    Olsthoorn, Mitchell
    Panichella, Annibale
    SEARCH-BASED SOFTWARE ENGINEERING, SSBSE 2022, 2022, 13711 : 67 - 82