Dynamically typed programming languages are popular in education and the software industry. While presenting a low barrier to entry, they suffer from run-time type errors and longer-term problems in code quality and maintainability. Statically typed languages, while showing strength in these aspects, lack in learnability and ease of use. In particular, fixing type errors poses challenges to both novice users and experts. Further, compiler-type error messages are presented in a static way that is biased toward the first occurrence of the error in the program code. To help users resolve such type errors, we introduce ChameleonIDE, a type debugging tool that presents type errors to the user in an unbiased way, allowing them to explore the full context of where the errors could occur. Programmers can interactively verify the steps of reasoning against their intention. Through three studies involving real programmers, we showed that ChameleonIDE is more effective in fixing type errors than traditional text-based error messages. This difference is more significant in harder tasks. Further, programmers actively using ChameleonIDE's interactive features are shown to be more efficient in fixing type errors than passively reading the type error output.
翻译:动态类型的编程语言在教育和软件行业中非常流行。虽然具有低门槛,但这些语言面临的问题包括运行时类型错误、长期的代码质量和可维护性问题。静态类型的语言在这些方面表现良好,但在学习和使用方面缺乏灵活性和易用性。特别地,修复类型错误对于初学者和专家都存在挑战。此外,编译器错误消息以静态方式呈现,这对程序代码中错误的第一个发生位置存在偏差。为了帮助用户解决此类类型错误,我们引入了ChameleonIDE,一种类型调试工具,以无偏见的方式向用户展示类型错误,允许他们探索错误可能发生的全部上下文。程序员可以交互式地验证逻辑推理的每一步。通过三项涉及真实程序员的研究,我们证明了ChameleonIDE在修复类型错误方面比传统的基于文本的错误消息更为有效。在较难的任务中,这种差异更为显著。此外,积极使用ChameleonIDE的交互特性的程序员在修复类型错误方面被证明比被动阅读类型错误输出的程序员更有效率。