paperbot · PL 论文追踪

全部论文 待读 收藏

P2 FlexType: A Plug-and-Play Framework for Type Inference Models

FlexType:面向类型推断模型的即插即用框架
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 4/10 · 论文聚焦 JavaScript/TypeScript 的交互式与自动类型推断 IDE 扩展,属于程序语言与静态分析工具方向,类型推断本身与静态分析相关。但摘要未涉及 LLM/Agent 与静态分析交叉、浮点程序分析或贝叶斯程序分析,与用户当前核心研究问题匹配有限。引用 2 inbox
Sivani Voruganti, Kevin Jesse, Premkumar Devanbu
crossref: 2026-09-12

AI 速览

一句话:提出 FlexType——一个可插拔的 IDE 扩展,能在 JavaScript 与 TypeScript 中交互或自动推断类型。

TypeScript 中的类型对变量与 API 的正确使用至关重要,显式类型标注可以避免变量或函数误用带来的类型错误。本文提出 FlexType:一个运行于 IDE 中、同时支持 JavaScript 与 TypeScript 的扩展,能够以交互式或全自动的方式推断类型,并作为类型推断模型的即插即用框架使用。作者在 JavaScript 上开展实验,考察若用 FlexType 将主流 JavaScript 项目迁移到 TypeScript,它能解析出多少类型。结果显示,FlexType 能以高精度与高置信度为全部类型中的 56.69% 完成标注,其中既包括原生类型,也包括从模块导入的类型。除自动推断外,作者认为该 Visual Studio Code 交互式扩展在 TypeScript 与 JavaScript 中都具备固有价值,尤其在类型推导对开发者而言负担较重的情况下更为有用。

问题
在 JavaScript 项目迁移到 TypeScript 或日常开发中,缺少类型标注导致变量与 API 误用,而人工补全和推断类型成本高。
方法
实现 FlexType:一个 Visual Studio Code 扩展形式的即插即用框架,可接入类型推断模型,为 JavaScript 与 TypeScript 提供交互式与自动化的类型推断。
评估
在 JavaScript 上做实验,衡量用 FlexType 迁移 Top JavaScript 项目时能解析出多少类型,报告其可高精度、高置信度标注 56.69% 的类型(含原生与模块导入类型)。
原文摘要(Abstract)

Types in TypeScript play an important role in the correct usage of variables and APIs. Type errors such as variable or function misuse can be avoided with explicit type annotations. In this work, we introduce FlexType, an IDE extension that can be used on both JavaScript and TypeScript to infer types in an interactive or automatic fashion. We perform experiments with FlexType in JavaScript to determine how many types FlexType could resolve if it were to be used to migrate top JavaScript projects to TypeScript. FlexType is able to annotate 56.69% of all types with high precision and confidence including native and imported types from modules. In addition to the automatic inference, we believe the interactive Visual Studio Code extension is inherently useful in both TypeScript and JavaScript especially when resolving types is taxing for the developer.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7277,
  title = {FlexType: A Plug-and-Play Framework for Type Inference Models},
  author = {Sivani Voruganti and Kevin Jesse and Premkumar Devanbu},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3559527}
}