Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming IT Technology

English To Code Converter 56

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.

English To Code Converter

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

    "Shoot yourself in the foot."
  • I can just write code like this:
    System.out prints a line "Hello, World"
    Move over Java!
  • 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."
  • by avalys ( 221114 )
    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...
  • Hey, wow... (Score:5, Funny)

    by k4_pacific ( 736911 ) <k4_pacific@yah[ ]com ['oo.' in gap]> on Friday March 25, 2005 @06:05PM (#12049856) Homepage Journal
    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.
  • by spencerogden ( 49254 ) <spencer@spencerogden.com> on Friday March 25, 2005 @06:14PM (#12049944) Homepage
    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.
    • Computer encounters ambiguous statement-> Computer: "Did you mean x?" User: No Computer: "Did you mean y?" User: No Computer: "Try to express the idea with different words. User: blah blah blah. Sure, it would suck for someone who already understood a programming language, but it would let someone with no idea how to program interact with the computer at a higher level...
    • I was thinking the same thing, how well will this system handle things like:
      "need program to handle customer tracking, should use Java,ASP.NET, and [some random non-existand acronym the boss just made up]. Program should also manage inventory, billing, and must integrate with programs X,Y and Z. Please have it done by the day after tomorrow."
  • 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?
  • by halber_mensch ( 851834 ) on Friday March 25, 2005 @06: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 )
    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.
  • by tcopeland ( 32225 ) * <tom AT thomasleecopeland DOT com> on Friday March 25, 2005 @07:02PM (#12050407) Homepage
    Yup, they're called "programmers".
  • Vaporware (Score:2, Interesting)

    by eurleif ( 613257 )
    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 @07:18PM (#12050515) Homepage
    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

  • Whoa. I entered "fuck you", and you won't believe the C I got back.
  • by Stevyn ( 691306 ) on Friday March 25, 2005 @10: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.
    • Because it's probably not going to work well. It's not even going to come close to working well, and it will not come close to working well any time in the immediate future. Those of us who have not had to deal with COBOL have at least heard stories about it- how the executives would think that "it's just like English, it MUST be easier to program!!!" and programmers would end up suffering with a language that combines the worst parts of programming (strict, rigid syntax) and English (verbosity) to get an a
      • But this is not a language. This thing takes English, and makes an outline of what should be done with it. Then you look at it, understand it in 2 seconds, and fill in the blanks. This, instead of writing all the tedious stuff yourself.
    • Computers should be a tool to help people, not require them to learn a new language just to communicate with them.

      But you're wrong, and that's precisely why people are crapping on the idea. You do have to learn a new language, and it is just different enough from English to piss you off. A bug in a formal programming language makes sense to the programmer because we can internalize the syntax and semantics of it, but we already have internalized the broader semantics of English such that the accepte

  • 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 (Score:3, Funny)

      by tengwar ( 600847 )
      They're actually pretty advanced in the work, and they've already bootstrapped the compiler. They've not actually released the source, so I'm taking bit of a risk in putting it up on the net, but here it is:

      Compile a METAFOR compiler.
  • by pocari ( 32456 ) on Saturday March 26, 2005 @03:38AM (#12052856)
    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?

    • But as they say, COBOL was an early attempt. This is not COBOL. Also, this does not require that you word yourself precisely: you type in stuff, and out comes code. If there's something amiss, then correct the typo, and the code gets corrected. Then take the code and do the actual work of implemeting everything needed, inside the frames that have now been conveniently made for you. Think of it like this:

      "You: I want to make a lah-di-dah program.
      Com: Make it look like this.
      You: Ok."

      If you're hard-core en

      • The same problem exists for a lot of specs that get as detailed as a program. The actual thinking needs to take place at a higher level. I am not convinced that you get more people who can think about software at a high level because of the tools; that takes some combination of education, experience, and natural inclination.

        Programming languages have the advantage of precision and programmers' tools like debuggers and syntax checkers. Toy language developers overlook this big step. So how exactly do y

  • 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: _

  • 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 b
  • Why bother? (Score:3, Interesting)

    by TheLink ( 130905 ) on Saturday March 26, 2005 @01:09PM (#12054545) Journal
    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.
  • 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 b

    • But I thought geeks couldn't get GFs!
    • But the MIT people seem to have one big talent for making publicity. And I'll give them credit for that.

      The project in the article comes from the MIT Media Lab, which is good at funding and publicity but lacks the intellectual rigor of the rest of MIT.

      Projects in the Program Analysis Group [mit.edu] in the EECS Department are more along the lines of tools for people who are professional programmers: upgrade testing, invariant discovery, fault detection.

  • 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 -
  • 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.
  • 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 obje

    • I think that your analysis of some of the above clauses is faulty.

      Your description of "John angered Bill." Is sufficient.

      However, "John disliked Bill." is more likely the John object modifying it's on property of 'liking/disliking' the Bill object. The Bill object need not do anything based on the precise meaning of that sentence. If you had said that "John dislikes Bill, because Bill stole his ball." then it becomes clear that there may be a cause for John taking on the property of dislike. However,
      • However, "John disliked Bill." is more likely the John object modifying it's on property of 'liking/disliking' the Bill object. The Bill object need not do anything based on the precise meaning of that sentence. If you had said that "John dislikes Bill, because Bill stole his ball." then it becomes clear that there may be a cause for John taking on the property of dislike. However, that is semanticly different than saying "Bill made John hate him."

        I agree, that's why I added "(indirectly)". The point is

  • ...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.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...