Stories
Slash Boxes
Comments

News for nerds, stuff that matters

English To Code Converter

Posted by Zonk on Fri Mar 25, 2005 04:52 PM
from the universal-translator dept.
prostoalex writes "Metafor from MIT is a code visualization utility, capable of converting high-level descriptions into class and function (or method, depending on which camp you're in) definitions. According to the screenshot, it looks like Metafor tries to figure out the components of the software application, defines classes, deduce actions, and generates some function (method) signatures. A PDF document by researchers is available from MIT: "We explore the idea of using descriptions in a natural language as a representation for programs. While we cannot yet convert arbi-trary English to fully specified code, we can use a reasonably expressive subset of English as a visualization tool. Simple descriptions of program objects and their behavior generate scaffolding (underspecified) code fragments, that can be used as feedback for the designer. Roughly speaking, noun phrases can be interpreted as program objects; verbs can be functions, adjectives can be properties. A surprising amount of what we call programmatic semantics can be inferred from linguistic structure. We present a program editor, Metafor, that dynamically converts a user's stories into program code, and in a user study, participants found it useful as a brainstorming tool." There's also an article about it on ACM."
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • Add this to the list... (Score:3, Funny)

    by NorbMan (829255) * on Friday March 25 2005, @04:54PM (#12049713)
    Shooting yourself in the foot (in Metafor):

    "Shoot yourself in the foot."
  • Finally... (Score:1)

    by 0x461FAB0BD7D2 (812236) on Friday March 25 2005, @05:00PM (#12049789)
    (Last Journal: Wednesday August 03 2005, @09:23AM)
    I can just write code like this:
    System.out prints a line "Hello, World"
    Move over Java!
  • uh oh... (Score:2)

    by Mad_Rain (674268) on Friday March 25 2005, @05:01PM (#12049809)
    (Last Journal: Sunday May 18 2003, @11:53PM)
    And you thought you had problems with auditing out comments with *ahem* language in poor taste...

    "you f-ckin' piece of sh-t! Work right or I'm gonna throw you in the d-mn river!"

    "syntax error."
  • MIT (Score:2)

    by avalys (221114) on Friday March 25 2005, @05:03PM (#12049823)
    I have a theory that MIT gets mentioned at least once a day on Slashdot.

    I was worried that today would pass without a reference, but here it is...
  • Maybe they can combine this with voice recognition software and just turn it on during the design meetings. After a while, the meeting will inevitably go off-topic into a discussion of the NCAA final four or something. The final product is then a combination business middleware/basketball game which is good as neither.
    • Re:Hey, wow... by AdamWeeden (Score:1) Friday March 25 2005, @11:16PM
    • 1 reply beneath your current threshold.
  • I'm sure if something lke this will be able to succeed until we see some big advances in AI and computers that are as tollerant of ambiguity as humans are.

    Programming languages grew out of a neccesity to have something that was easy to remember (by virtue of its similarities to english), yet still precise enough for the computer to interpret. At a certain point you still need to define a vocabulary with consistent semantics to be applied to programming concepts.

    Whether or not that vocabulary is very rich and sounds almost like spoken english, it all goes out the window when a phrase is used by the speaker in a different meaning than the system had in mind.

    There is a good reason that mathematics has its own language. In fact, any specialised are has its own jargon, even its not technical. General purpose English is just too vague to use in some domains.

    AI problems always seem to be perpetualy 'a decade' in the future.
  • I shudder at the thought of some computer-tard (like my mother) using English to write programs. Just imagine the havoc that will result!

    (15 yr old male during peak of puberty)
    "Computer, write me a program that downloads all the pr0n on the internet to the my PC!!!!111one"

    (80 yr old male, retired and bored out of his mind)
    "Noisy hunk of crap on the floor, send every naked picture of every woman ever to my printer! Oh wait, make sure they are 19 or younger too!!! Keh keh keh!"

    ...>_>
  • Isn't this just the New Cobol?
    • 1 reply beneath your current threshold.
  • program, i can! (Score:3, Funny)

    by halber_mensch (851834) on Friday March 25 2005, @05:25PM (#12050077)
    yoda: When 900 years old you reach, look as good you will not!

    class You:
    look = as_good
    def reach(years):
    if( years = 900 ):
    self.look = not as_good

  • Intriguing. (Score:2, Funny)

    by CDarklock (869868) on Friday March 25 2005, @05:29PM (#12050117)
    (http://www.darklock.com/blog/ | Last Journal: Tuesday August 28, @02:44PM)
    I'd be interested in seeing how well this sort of thing works with procedural code, e.g. the overview descriptions you might write as a comment in a function body before you start writing the "real" function. I don't see a lot of productive stuff coming out of this as it stands now... nouns turn into classes and verbs turn into methods, but that seems to be about it.
  • Yup, they're called "programmers".
  • Vaporware (Score:2, Interesting)

    by eurleif (613257) on Friday March 25 2005, @06:17PM (#12050509)
    Am I the only one here who's reminded of the countless other "amazing programs" with glowing writeups and great-looking screenshots that are never actually released? When I see a download link, I'll believe it.
  • I'm skeptical... (Score:3, Insightful)

    by bergeron76 (176351) * on Friday March 25 2005, @06:18PM (#12050515)
    Even AskJeeves.com doesn't come up with the right answers to many "plain-english" questions; why would one think that something as complex as writing software would be an easier feat?

    In a few years, this might be more plausible; but I think it's going to take a hell of a lot of work.

    Perhaps they should focus on the new hybrid english/weblish dialect. More kids/teenagers/new-hires will speak that language; and it seems much easier to dissect because of the lack of adjectives and adverbs.

    L8tr

  • Graphic detail (Score:1)

    by Tablizer (95088) on Friday March 25 2005, @09:17PM (#12051552)
    (http://www.geocities.com/tablizer | Last Journal: Saturday March 15 2003, @01:22PM)
    Whoa. I entered "fuck you", and you won't believe the C I got back.
  • by Stevyn (691306) on Friday March 25 2005, @09:24PM (#12051596)
    Yeah, sure right now it's not perfect, but it's a good idea. Computers should be a tool to help people, not require them to learn a new language just to communicate with them. I think this is a step in the direction of computers being a part of our lives that actually helps us instead just becoming another appliance.
  • Binary? (Score:1)

    by Gaspo (862470) <jgasparini@gmail.com> on Saturday March 26 2005, @12:11AM (#12052396)
    So are they just gonna kinda wave their wonderful piece of software around, or might they release a binary, or at least source, so that those of us who might ever use it can see if it's any good?
    • DWIM by tengwar (Score:3) Saturday March 26 2005, @05:36PM
  • COBOL, fun, and lawyers (Score:4, Insightful)

    by pocari (32456) on Saturday March 26 2005, @02:38AM (#12052856)
    (http://brian2.blogspot.com/)
    The idea of basing a programming language upon natural lan-guage dates back to the earliest days of high-level programming languages. COBOL was an attempt to make programming code as similar as possible to English, in contrast to FORTRAN's metaphor of mathematical formulae. The hope was to make programming accessible to non-technical business users....most importantly, we hope interfaces like Metafor can put some of the fun back into programming.

    When did programming in conventional non-COBOL languages cease to be fun? In fact, I've never hear someone describe COBOL programming as fun (cf. COBOL fingers [outpost9.com]). I've even had fun using FORTRAN, as it was the only way to use a cool plotter, and, later, a parallel supercomputer.

    Besides, people who try to express things precisely in English are called lawyers, and we don't want to become that, do we?

  • You are in a twisty maze of little statements all different.

    > Create a map

    Exception `NorthPoleError' thrown from Compass.eng:87 ( `Can't find north' )
    from stdio.eng:56
    from pacman.eng:22

    F&W EOS DB: _

  • Idiot Check (Score:1)

    Humans are still much better at recognizing patterns of references in written language than are our computers. Metafor could be useful in automating some code audits. Run the design docs through Metafor, then diff its generated code with the human generated code. When humans read the diffs, we can see where the code and docs diverge. Then we can update the docs or the code, where either differ from the required product. The process probably won't get down into the really subtle differences, and there will be plenty of false positives and negatives until the software matures. But it might just automate the weeding of, say, the first 20% of differences. Which would still make it worth running. Let the computers battle each other wherever possible, before throwing a human into the arena, to battle the human mistakes.
  • Why bother? (Score:3, Interesting)

    by TheLink (130905) on Saturday March 26 2005, @12:09PM (#12054545)
    (Last Journal: Saturday January 06 2007, @01:13AM)
    If you want something like that, just outsource to India :).

    The problem is not whether it's in English or something else.

    The benefit of experienced programmers is that they know Marketing is going to change their minds and want such and such a feature months later, so they just get ready for it well in advance. Even if it's not in the spec written in English or whatever language.

    You can already write code in English. If you write it well enough, cheap programmers can compile it to their programming language of choice. And the main benefit is the cheap programmers can continue maintaining the software, and you can move on to writing other stuff.
  • What's their true talent? (Score:2, Insightful)

    by ralejs (779782) on Saturday March 26 2005, @04:55PM (#12056270)
    (http://www.cs.chalmers.se/~josefs)
    Like many other posters I'm not totally impressed with this piece of work. I guess that ever since programming languages have been around people have tried the idea of programming a computer with natural language. But natural language is inherently bad for this task due to its imprecision.

    There is some related work which I find much more convincing. It's the work on Grammatical Framework [chalmers.se] (GF). GF is a programming language for writing multi lingual grammars. In GF you can if you wish specify the relation between a natural language and a programming language and write programs in the natural language. But that would not be idiomatic GF. Instead they have an editor where you can construct your natural language text out of a number of choices which makes sense in that particular context. The GF guys have also made successful experiments with converting OCL specification to and from several natural languages such as English, Swedish and German.

    But the MIT people seem to have one big talent for making publicity. And I'll give them credit for that.

  • by itomato (91092) <juddy@juddy.org> on Saturday March 26 2005, @09:15PM (#12057648)
    (http://juddy.org/)
    I think I'd get as much out of reading the "English" that those MIT guys feed the Converter..

    "Now that we're done thinking about eating, we're going to resume thinking about _main_..."

    If that's plain english to the converter, it seems like it would need another level of conversion before you could stand back and watch a cluster chew through the Million Book Project and generate executable Shakespeare.

    Romeo and Juliet in C.

    You'd have to break down the semantics of literature, the generalities at least - with the whole beginning, subject, character attributes, etc., and make the appropriate translations into C, Java, what have you..

    But wow - what a fulfillment of the promise of a giant Computer Brain. One step closer to JOSHUA!

    But the point is, I personally would get a lot out of colorful, storybook-like Programming Instruction, even with something as simple as Pac-Man.
  • by Money for Nothin' (754763) on Sunday March 27 2005, @12:39AM (#12058491)
    COBOL.

    Welcome to 1959! [wikipedia.org]
  • UML to Code (Score:1)

    by naros (518116) on Sunday March 27 2005, @11:59AM (#12060340)
    (http://www.benjaminarai.com/)
    UML to Code is the same kind of thing and its stupid. Various attempts have been tried to get the UML to transfer to code but it really only works for framework type code and not the logic based stuff that is actually the harder part.
  • by brpr (826904) on Sunday March 27 2005, @01:25PM (#12060745)

    I can't find anything about the details of this system in the links, but if it really is using such a simplistic mapping between sentence structure and OO design, it's going to get in trouble. For example, consider the fact that subjects of different verbs can have completely different semantic roles:

    John angered Bill.
    John disliked Bill.

    Translated into OO language, the first sentence talks about the John object modifying a property of the Bill object, but the second sentence talks about the Bill object (perhaps indirectly) modifying a property of the John object. I suppose it's possible that the system's database of common sense knowledge could be used to get around this sort of issue.

    However, there are more difficult situations, such as the one described by this sentence:

    Bill and John hate each other.

    It's not clear whether this situation should be represented by giving Bill the "hates John" property and John the "hates Bill" property, or by having a list of hates(X, Y) statements separate from the properties of individual objects (this would be much more efficient in some cases). The problem is more acute with some predicates than others; consider the following:

    The ball is near John's foot

    It is clearly absurd to give the ball a "near John's foot" property and John a "near the ball property" -- imagine how many properties each object would have to have if there were 100 objects in the same space!

    Finally, if you wanted to tell the system about a new verb, you'd have to have some way of telling it about all the verb's subtle semantic properties.

    It's possible that the system solves these problems, but I'll believe it when I see it. Natural language interpretation is very, very hard.

  • by suitepotato (863945) on Monday March 28 2005, @02:36PM (#12068506)
    ...can we please forcibly re-educate all programmers who will not properly, logically, and clearly document their code? I think it more important that we help each other understand machine code which we created, than help machines understand human code. It's like being too lazy to write magazine articles properly and instead writing an AI word processor to rephrase everything for us which is ten times more work than just doing it right in the first place.
  • by ShoalinMan (871627) on Wednesday March 30 2005, @07:07AM (#12087463)
    If the computer starts interpreting natural language, then what's our job? -- "Don't allow others know you are useless" --
    [ Parent ]
  • 5 replies beneath your current threshold.