JAVA']JAVA & LAMBDA: A FEATHERWEIGHT STORY

被引:4
|
作者
Bettini, Lorenzo [1 ]
Bono, Viviana [2 ]
Dezani-Ciancaglini, Mariangiola [2 ]
Giannini, Paola [3 ]
Venneri, Betti [1 ]
机构
[1] Univ Firenze, Dipartimento Stat, Informat, Applicaz, Florence, Italy
[2] Univ Torino, Dipartimento Informat, Turin, Italy
[3] Univ Piemonte Orientale, Dipartimento Sci & Innovaz Tecnol, Vercelli, Italy
基金
欧盟地平线“2020”;
关键词
OBJECT;
D O I
10.23638/LMCS-14(3:17)2018
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
We present FJ &, a new core calculus that extends Featherweight Java (FJ) with interfaces, supporting multiple inheritance in a restricted form, lambda-expressions, and intersection types. Our main goal is to formalise how lambdas and intersection types are grafted on Java 8, by studying their properties in a formal setting. We show how intersection types play a significant role in several cases, in particular in the typecast of a lambda-expression and in the typing of conditional expressions. We also embody interface default methods in FJ &, since they increase the dynamism of lambda-expressions, by allowing these methods to be called on lambda-expressions. The crucial point in Java 8 and in our calculus is that lambda-expressions can have various types according to the context requirements (target types): indeed, Java code does not compile when lambda-expressions come without target types. In particular, in the operational semantics we must record target types by decorating lambda-expressions, otherwise they would be lost in the runtime expressions. We prove the subject reduction property and progress for the resulting calculus, and we give a type inference algorithm that returns the type of a given program if it is well typed. The design of FJ & has been driven by the aim of making it a subset of Java 8, while preserving the elegance and compactness of FJ. Indeed, FJ & programs are typed and behave the same as Java programs.
引用
收藏
页数:24
相关论文
共 50 条
  • [42] A dualthreaded Java']Java processor for Java']Java multithreading
    Chung, CM
    Kim, SD
    [J]. 1998 INTERNATIONAL CONFERENCE ON PARALLEL AND DISTRIBUTED SYSTEMS, PROCEEDINGS, 1998, : 693 - 700
  • [43] Java']Java: Coordination and communication for Java']Java agents
    Ciancarini, P
    Rossi, D
    [J]. MOBILE OBJECT SYSTEMS: TOWARDS THE PROGRAMMABLE INTERNET, 1997, 1222 : 213 - 226
  • [44] Flow Java']Java: Declarative concurrency for Java']Java
    Drejhammar, F
    Schulte, C
    Brand, P
    Haridi, S
    [J]. LOGIC PROGRAMMING, PROCEEDINGS, 2003, 2916 : 346 - 360
  • [45] Java']Java
    不详
    [J]. IEEE INTERNET COMPUTING, 1999, 3 (02) : 13 - 13
  • [46] Java']Java
    不详
    [J]. JOURNAL OF OBJECT-ORIENTED PROGRAMMING, 1996, 9 (06): : 96 - 96
  • [47] GSTARI model of BPR assets in West Java']Java, Central Java']Java, and East Java']Java
    Susanti, Susi
    Handajani, Sri Sulistijowati
    Indriati, Diari
    [J]. 7TH INTERNATIONAL SEMINAR ON NEW PARADIGM AND INNOVATION ON NATURAL SCIENCE AND ITS APPLICATION, 2018, 1025
  • [48] Compiling, assembling and executing Java']Java using Java']Java - Compiler construction using Java']Java
    Pedersen, JB
    Wagner, A
    [J]. PDPTA'2001: PROCEEDINGS OF THE INTERNATIONAL CONFERENCE ON PARALLEL AND DISTRIBUTED PROCESSING TECHNIQUES AND APPLICATIONS, 2001, : 1820 - 1826
  • [49] 'JAVA']JAVA'
    FERSTER, J
    [J]. GEORGIA REVIEW, 1981, 35 (01): : 77 - 77
  • [50] Java']Java
    Mateosian, R
    [J]. IEEE MICRO, 1996, 16 (03) : 3 - 5