Merging Gradual Typing

被引:0
|
作者
Ye, Wenjia [1 ]
Oliveira, Bruno C.D.S. [1 ]
Toro, Matías [1 ]
机构
[1] The University of Hong Kong, Hong Kong
关键词
!text type='Java']Java[!/text] programming language - Model checking - Syntactics;
D O I
10.1145/3689734
中图分类号
学科分类号
摘要
Programming language mechanisms with a type-directed semantics are nowadays common and widely used. Such mechanisms include gradual typing, type classes, implicits and intersection types with a merge operator. While sharing common challenges in their design and having complementary strengths, type-directed mechanisms have been mostly independently studied. This paper studies a new calculus, called λM★, which combines two type-directed mechanisms: gradual typing and a merge operator based on intersection types. Gradual typing enables a smooth transition between dynamically and statically typed code, and is available in languages such as TypeScript or Flow. The merge operator generalizes record concatenation to allow merges of values of any two types. Recent work has shown that the merge operator enables modelling expressive OOP features like first-class traits/classes and dynamic inheritance with static type-checking. These features are not found in mainstream statically typed OOP languages, but they can be found in dynamically or gradually typed languages such as JavaScript or TypeScript. In λM★, by exploiting the complementary strengths of gradual typing and the merge operator, we obtain a foundation for modelling gradually typed languages with both first-class classes and dynamic inheritance. We study a static variant of λM★ (called λM); prove the type-soundness of λM★; show that λM★ can encode gradual rows and all well-typed terms in the GT FL calculus; and show that λM★ satisfies gradual typing criteria. The dynamic gradual guarantee (DGG) is challenging due to the possibility of ambiguity errors. We establish a variant of the DGG using a semantic notion of precision based on a step-indexed logical relation. © 2024 owner/author(s)
引用
收藏
相关论文
共 50 条
  • [41] Gradual Typing Performance, Micro Configurations and Macro Perspectives
    Khan, Mohammad Wahiduzzaman
    Chen, Sheng
    THEORETICAL ASPECTS OF SOFTWARE ENGINEERING, TASE 2024, 2024, 14777 : 261 - 278
  • [42] Typed and Confused: Studying the Unexpected Dangers of Gradual Typing
    Troppmann, Dominic
    Fass, Aurore
    Staicu, Cristian-Alexandru
    Proceedings - 2024 39th ACM/IEEE International Conference on Automated Software Engineering, ASE 2024, : 1858 - 1870
  • [43] Toward Efficient Gradual Typing for Structural Types via Coercions
    Kuhlenschmidt, Andre
    Almahallawi, Deyaaeldeen
    Siek, Jeremy G.
    PROCEEDINGS OF THE 40TH ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '19), 2019, : 517 - 532
  • [44] Space-Efficient Polymorphic Gradual Typing, Mostly Parametric
    Igarashi, Atsushi
    Ozaki, Shota
    Sekiyama, Taro
    Tanabe, Yudai
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (PLDI):
  • [45] Transitioning from Structural to Nominal Code with Efficient Gradual Typing
    Muehlboeck, Fabian
    Tate, Ross
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5 (OOPSLA):
  • [47] Dynamic Type Inference for Gradual H ndley-Milner Typing
    Miyazaki, Yusuke
    Sekiyama, Taro
    Igarashi, Atsushi
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (POPL):
  • [48] Corpse Reviver: Sound and Efficient Gradual Typing via Contract Verification
    Moy, Cameron
    Nguyen, Phuc C.
    Tobin-Hochstadt, Sam
    Van Horn, David
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5 (POPL):
  • [49] Abstracting Gradual Typing Moving Forward: Precise and Space-Efficient
    Schwerter, Felipe Banados
    Clark, Alison M.
    Jafery, Khurram A.
    Garcia, Ronald
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5 (POPL):
  • [50] The gradual merging of repository and CRIS solutions to meet institutional research information management requirements
    de Castro, Pablo
    Shearer, Kathleen
    Summann, Friedrich
    12TH INTERNATIONAL CONFERENCE ON CURRENT RESEARCH INFORMATION SYSTEMS (CRIS 2014): MANAGING DATA INTENSIVE SCIENCE: THE ROLE OF RESEARCH INFORMATION SYSTEMS IN REALISING THE DIGITAL AGENDA, 2014, 33 : 39 - 46