使用大规模代码异常检测来改进Kotlin编译器
Using Large-Scale Anomaly Detection on Code to Improve Kotlin Compiler
摘要:
在这项工作中,我们应用异常检测源代码和字节码,以促进程序设计语言及其编译器的发展。我们将异常定义为与用特定程序设计语言编写的典型代码不同的代码片段。识别这些代码片段对语言开发人员和最终用户都有好处,因为异常可能表明编译器或运行时性能存在潜在问题。此外,异常可能对应于语言设计中的问题。在这项研究中,我们选择Kotlin作为目标程序设计语言。我们概述并讨论了获得源代码和字节码的向量表示以及在向量化代码片段中检测异常的方法。本文提出了一种方法,旨在检测两种类型的异常:语法树异常和所谓的编译器引起的异常,只出现在编译的字节码。我们描述了几个实验,采用不同的向量化和异常检测技术的组合,并讨论检测到的异常类型及其对语言开发人员的有用性。我们证明,提取的异常和基本的提取技术提供了额外的价值语言的发展。
英文摘要:
In this work, we apply anomaly detection to source code and bytecode to facilitate the development of a programming language and its compiler. We define anomaly as a code fragment that is different from typical code written in a particular programming language. Identifying such code fragments is beneficial to both language developers and end users, since anomalies may indicate potential issues with the compiler or with runtime performance. Moreover, anomalies could correspond to problems in language design. For this study, we choose Kotlin as the target programming language. We outline and discuss approaches to obtaining vector representations of source code and bytecode and to the detection of anomalies across vectorized code snippets. The paper presents a method that aims to detect two types of anomalies: syntax tree anomalies and so-called compiler-induced anomalies that arise only in the compiled bytecode. We describe several experiments that employ different combinations of vectorization and anomaly detection techniques and discuss types of detected anomalies and their usefulness for language developers. We demonstrate that the extracted anomalies and the underlying extraction technique provide additional value for language development.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。