Static Blame for gradual typing

被引:0
作者
Su, Chenghao [1 ]
Chen, Lin [1 ]
Yanhui, Li [1 ]
Zhou, Yuming [1 ]
机构
[1] Nanjing Univ, State Key Lab Novel Software Technol, Nanjing, Peoples R China
基金
中国国家自然科学基金;
关键词
DESIGN;
D O I
10.1017/S0956796824000029
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Gradual typing integrates static and dynamic typing by introducing a dynamic type and a consistency relation. A problem of gradual type systems is that dynamic types can easily hide erroneous data flows since consistency relations are not transitive. Therefore, a more rigorous static check is required to reveal these hidden data flows statically. However, in order to preserve the expressiveness of gradually typed languages, static checks for gradually typed languages cannot simply reject programs with potentially erroneous data flows. By contrast, a more reasonable request is to show how these data flows can affect the execution of the program. In this paper, we propose and formalize Static Blame, a framework that can reveal hidden data flows for gradually typed programs and establish the correspondence between static-time data flows and runtime behavior. With this correspondence, we build a classification of potential errors detected from hidden data flows and formally characterize the possible impact of potential errors in each category on program execution, without simply rejecting the whole program. We implemented Static Blame on Grift, an academic gradually typed language, and evaluated the effectiveness of Static Blame by mutation analysis to verify our theoretical results. Our findings revealed that Static Blame exhibits a notable level of precision and recall in detecting type-related bugs. Furthermore, we conducted a manual classification to elucidate the reasons behind instances of failure. We also evaluated the performance of Static Blame, showing a quadratic growth in run time as program size increases.
引用
收藏
页数:44
相关论文
共 56 条
  • [1] Ahmed A, 2017, P ACM PROGRAM LANG, V1, DOI 10.1145/3110283
  • [2] Blame for All
    Ahmed, Amal
    Findler, Robert Bruce
    Siek, Jeremy G.
    Wadler, Philip
    [J]. POPL 11: PROCEEDINGS OF THE 38TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2011, : 201 - 214
  • [3] Schwerter FB, 2014, ICFP'14: PROCEEDINGS OF THE 2014 ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING, P283, DOI 10.1145/2628136.2628149
  • [4] Bauman S, 2015, PROCEEDINGS OF THE 20TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING (ICFP'15), P22, DOI 10.1145/2784731.2784740
  • [5] Bierman G, 2014, LECT NOTES COMPUT SC, V8586, P257
  • [6] Blanchet B, 2002, LECT NOTES COMPUT SC, V2566, P85
  • [7] Practical Optional Types for Clojure
    Bonnaire-Sergeant, Ambrose
    Davies, Rowan
    Tobin-Hochstadt, Sam
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS (ESOP 2016), 2016, 9632 : 68 - 94
  • [8] Migrating Gradual Types
    Campora, John Peter
    Chen, Sheng
    Erwig, Martin
    Walkingshaw, Eric
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2 (POPL):
  • [9] Taming Type Annotations in Gradual Typing
    Campora, John Peter
    Chen, Sheng
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (04):
  • [10] On Type-Cases, Union Elimination, and Occurrence Typing
    Castagna, Giuseppe
    Laurent, Mickael
    Nguyen, Kim
    Lutze, Matthew
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (POPL):