In today's software world with its cornucopia of reusable software libraries, when a programmer is faced with a programming task that they suspect can be completed through the use of a library, they often look for code examples using a search engine and then manually adapt found examples to their specific context of use. We put forward a vision based on a new breed of developer tools that have the potential to largely automate this process. The key idea is to adapt code autocompletion tools such that they take into account not only the developer's already-written code but also the intent of the task the developer is trying to achieve next, formulated in plain natural language. We call this practice of enriching the code with natural language intent to facilitate its completion natural language-guided programming. To show that this idea is feasible we design, implement and benchmark a tool that solves this problem in the context of a specific domain (data science) and a specific programming language (Python). Central to the tool is the use of language models trained on a large corpus of documented code. Our initial experiments confirm the feasibility of the idea but also make it clear that we have only scratched the surface of what may become possible in the future. We end the paper with a comprehensive research agenda to stimulate additional research in the budding area of natural language-guided programming.
翻译:在当今的软件世界中,有可再使用软件图书馆的角形,当程序员面临他们怀疑可以通过使用图书馆完成的编程任务时,他们往往会寻找使用搜索引擎的代码示例,然后根据具体使用环境手工调整发现的实例。我们提出了一个基于新一代开发工具的愿景,这些开发工具有可能在很大程度上使这一过程自动化。关键的想法是修改代码自动完成工具,使其不仅考虑到开发者已经编写的代码,而且考虑到开发者正在试图实现下一个以自然语言编制的编程任务的意图。我们称之为用自然语言丰富代码的做法,目的是为完成自然语言指导的编程提供便利。为了表明这一理念是可行的,我们设计、实施和基准使用一个工具,在特定领域(数据科学)和特定编程语言(Python)中解决这一问题。工具的核心是使用经过大量有文件记录的代码培训的语言模型。我们最初的实验证实了这一理念的可行性,但也清楚地表明,我们只是用自然语言来丰富了该代码的自然语言的精髓研究领域,因此我们只能从新的方向研究领域入未来。