Speaking the Same Language
A Media Lab project makes programming more natural
By Lisa Scanlon
Hugo liu '01, Mng '02, a doctoral candidate at the Media Lab, remembers a particularly grueling introductory programming class he took as an undergrad: it was "pretty hellish," he recalls. This was partly because programming languages, he says, are "rigid and unaccommodating to people's natural input." Liu, who is interested in cognitive linguistics, wondered whether he could make programming more intuitive by having a computer derive code directly from natural language. The result was an interface, called Metafor, that translates English sentences into fragments of code. For example, noun phrases are interpreted as program objects, and verbs are interpreted as functions. Although Metafor doesn't produce complete programs, it can be used as a brainstorming tool to teach students how to write better code and to help programmers outline large projects, Liu says.
To use Metafor, programmers simply type in sentences--such as "Pac-Man is a character who loves to run through a maze and eat dots"--that describe the programs they want to write. Metafor parses the sentences into verbs, subjects, and objects and then translates those pieces into series of properties, functions, and if-then rules. By seeing how their sentences translate into code, students learn how to rephrase their statements to result in more-efficient programs, Liu says. In a paper he presented earlier this year, Liu described how Metafor could help beginning and intermediate programmers code faster.
Comments
05/07/2006
Posts:1