By Roland Piquepaille
Hugo Liu, a researcher at the MIT, thinks about using English as a programming language because it is much more concise than any traditional programming language, and eliminates the need to learn one in the first place. In "Tool turns English to code," Technology Review writes that Liu and his colleague have written an English-to-code visualizer named Metafor. You type a story in plain English in one panel of the tool. In other panels, you can see the outputs of the parser and the debugger. Finally the fourth panel contains your story rendered as code -- or the program "skeleton." Here is an example taken from Liu's research. 'If I said, "Look in the bin and pick out just the red apples," that's the equivalent of programming: "map(Pick, filter(lambda apple: apple.color == red, bin.getApples()))."' Read more...Here is the introduction of the Technology Review article.
Writing software has been relatively difficult since people began programming computers in the mid-1900s. Although programming a computer is eminently useful -- it gives you fine control of a powerful tool -- it requires learning a programming language.
Researchers from the Massachusetts Institute of Technology are aiming to remove this requirement. They have taken a step toward that goal with a language-to-code visualizer dubbed Metafor.
The visualizer uses natural language instructions to sketch the outlines of a program. It can be used as a programming learning tool and to provide rough drafts of programming projects, and could lead to more complete programming-by-natural-language methods.
The illustration above shows you how the different panels of Metafor.
But how does this work?
The basic logic of the program Pacman, for instance, is revealed by talking about how it works, said Liu. "The basic ingredients for the program are there -- the noun phrases are objects, the verbs are functions, [and] the adjectives are object properties."
Metafor translates the description "Pacman is a character who eats dots" into a "Pacman object" that is a member of and can share traits, or functions, with a "character superclass" and has a character superclass member function of "eat dots", said Liu.
Please read the full article for more details, but note that Metafor can 'translate' an English story in several programming languages, including Python, Lisp and Java.
But what can you do with such a tool?
The first goal is to help students to learn programming. This method could also be used as a programming teaching tool for kids or enhanced storytelling within three years.
For more information, you can read this technical paper, "Metafor: Visualizing Stories as Code" (PDF format, 3 pages, 723 KB), or this presentation, "english: the lightest weight programming language of them all" (PDF format, 22 slides, 2.34 MB). The illustration above comes from this presentation.
You also can watch this animated demo (QuickTime format, size unknown).
Sources: Kimberly Patch, Technology Research News, March 23/30, 2005; and various pages at MIT
Related stories can be found in the following categories.
Famous quotes containing the words english, programming and/or language:
“The English may not always be the best writers in the world, but they are incomparably the best dull writers.”
—Raymond Chandler (18881959)
“If there is a price to pay for the privilege of spending the early years of child rearing in the drivers seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.”
—Melinda M. Marshall (20th century)
“I shall christen this style the Mandarin, since it is beloved by literary pundits, by those who would make the written word as unlike as possible to the spoken one. It is the style of all those writers whose tendency is to make their language convey more than they mean or more than they feel, it is the style of most artists and all humbugs.”
—Cyril Connolly (19031974)