Content area

Abstract

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.

Details

Title
Static Blame for gradual typing
Author
Su, Chenghao 1   VIAFID ORCID Logo  ; Chen, Lin 2   VIAFID ORCID Logo  ; Li, Yanhui 3   VIAFID ORCID Logo  ; Zhou, Yuming 4   VIAFID ORCID Logo 

 State Key Laboratory for Novel Software Technology, Nanjing University, China (e-mail: [email protected]
 State Key Laboratory for Novel Software Technology, Nanjing University, China (e-mail: [email protected]
 State Key Laboratory for Novel Software Technology, Nanjing University, China (e-mail: [email protected]
 State Key Laboratory for Novel Software Technology, Nanjing University, China (e-mail: [email protected]
Publication title
Volume
34
Publication year
2024
Publication date
Mar 2024
Publisher
Cambridge University Press
Place of publication
Cambridge
Country of publication
United Kingdom
ISSN
09567968
e-ISSN
14697653
Source type
Scholarly Journal
Language of publication
English
Document type
Journal Article
Publication history
 
 
Online publication date
2024-03-25
Milestone dates
2022-08-08 (Received); 2024-01-11 (Revised); 2024-02-12 (Accepted)
Publication history
 
 
   First posting date
25 Mar 2024
ProQuest document ID
2973800122
Document URL
https://www.proquest.com/scholarly-journals/static-blame-gradual-typing/docview/2973800122/se-2?accountid=208611
Copyright
© The Author(s), 2024. Published by Cambridge University Press. This work is licensed under the Creative Commons Attribution License This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited. (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Last updated
2024-08-27
Database
ProQuest One Academic