Computer, make me a program! Researchers find a way to code using plain English

MIT, Christine Daniloff
An example of the researchers' system returning computing syntax from regular English.

Programmers often spend years in school learning how to program. Now, researchers say that they have come up with a way that may allow even the most inexperienced person to develop code.

Writing computer programs has always generally required using special-purpose languages like C++, Fortran, or Assembly language. In a pair of research papers (PDF links), computer scientists at MIT's Computer Science and Artificial Intelligence Laboratory (CSAIL) investigated if it's possible to write programs using natural langage—that is, the sort of language we speak or write with on a daily basis. As it turns out, it might be—for some things, anyway.

In order to demonstrate this, the researchers created a system to train a computer how to convert natural-language descriptions into regular expressions—a pattern or sequence that is assigned to a string of data (letters, variables, etc. written in a certain manner) so that the program can interpret exactly what it is trying to say. This makes it so the system doesn't get confused when you say "Let's eat Grandpa," but really meant, "Let's eat, Grandpa". Regular expressions can make file searches more flexible than a normal search function in desktop software.

The researchers gave the system text specifications for different file formats. The text specifications were written in natural language and the system automatically learned how to interpret the text and convert it into programming jargon so that the computer could properly read the data in the different file formats.

For instance, when given the natural-language text description "three letter word starting with 'X'," the system returns the regular expression "\bX[A-Za-z]{2}\b." As demonstrated in both papers, this system is able to interpret much longer and more complicated text specifications and convert them into regular expressions.

MIT Paper: From Naturual Language Specifications to Program Input Parsers
An example of regular text being converted in computing syntax.

While the above example may not look like much of anything to the casual observer, this system creates what computer scientists call input parsing programs, which help the software understand the exact meaning of a sentence or expression. The above example, "\bX[A-Za-z]{2}\b," is the exact definition in the computing world of a "three letter word starting with 'X' and when that is put into a search it will return only exactly that.

Natural-language programming may not yet help the non-programmer to suddenly become an expert coder, and it is currently limited in what it can do, is definitely a start. In time, as the field of computing linguistics grows, it may be possible to write entire software using the language that you grew up speaking.

[MIT (Christine DaniloffFrom Naturual Language Specifications to Program Input Parsers)]

Follow @TechHive on Twitter today.

This story, "Computer, make me a program! Researchers find a way to code using plain English" was originally published by TechHive.

To comment on this article and other PCWorld content, visit our Facebook page or our Twitter feed.
Shop Tech Products at Amazon