Slashdot Mirror


Metafor: Translating Natural Language to Code

vivin writes "Computer programming is second nature to most of the Slashdot crowd. However, this is not true for the vast majority of people. Formal programming languages are not as expressive or flexible as natural languages. This becomes more evident when we try to translate user requirements into actual code. Researchers at MIT have come up with a program that bridges this gap. It's not so much a tool that turns English into code, as it is a program that translates requirements (in English) to code. When Metafor analyzes English, nouns phrases become objects, verbs become functions, and adjectives become object attributes (or properties). In addition to helping programmers visualize their program better, I think it also promotes writing concise (and therefore) requirements and descriptions. Metafor doesn't handle run-on sentences (or bad English) that well." Update For for the dupe. Not going well. Appreciate all the hate mail. Really encourages improvement.

29 of 475 comments (clear)

  1. cool by Anonymous Coward · · Score: 1, Funny

    can it translate back into English?

  2. I can imagine... by JamesP · · Score: 4, Funny

    Verbs translated to functions?? Nouns to variables??

    int jerk_at_counter, hottie_in_accountancy, dork_at_it;

    kill(boss);
    send(intern,hell);

    Yeah, that will work...

    --
    how long until /. fixes commenting on Chrome?
    1. Re:I can imagine... by Infinityis · · Score: 2, Funny

      I'll bet this will cause problems for SCO...The only code they can patent by this method is

      while (true) {
      file(lawsuit);
      }

  3. Great! by Eusebo · · Score: 5, Funny

    Now all we need is a tool that will take a user's brain and turn it into solid requirements.

    --
    It is quite simple
    Haiku should not be funny
    Try a Senryu
  4. of little value here! by hugesmile · · Score: 4, Funny
    Metafor doesn't handle run-on sentences (or bad English) that well."

    Forget it being a tool for this crowd then!

    1. Re:of little value here! by hugesmile · · Score: 1, Funny
      Value(Natural_Language_Interface) = Unvaluable

      For i=1 to count(This_crowd)
      i.remove(tool_from_toolkit)
      next i

      Stop

      We're getting there....

  5. Re:Dupe by Anonymous Coward · · Score: 5, Funny

    I'm about to write a program that stops dupes:

    "Don't allow dupes."

    There, now I have to decide whether it will be FOSS.

  6. It is coming to pass... by HaeMaker · · Score: 4, Funny

    "Make it possible for programmers to write programs in English, and you will find that programmers can not write in English."

    http://www.murphys-laws.com/murphy/murphy-comput er .html

  7. Because the average joe wants to be a programmer? by Proc6 · · Score: 5, Funny

    Yeah, I know my neighbor with an IQ of 7 would rather be writing code that parses XML work orders and turns them into statistical graphs than watching NASCAR. It's just that complicated Java syntax kicks his ass so he's kicking back with a 6 pack of Black Label waiting for this technology to come out.

    --

    I'm Rick James with mod points biatch!

  8. you must be new here by avi33 · · Score: 5, Funny

    Computer programming is second nature to most of the Slashdot crowd.

    Maybe back in 1998, but haughty sniping is second nature to most of the Slashdot crowd now.

    1. Re:you must be new here by NardofDoom · · Score: 2, Funny

      Am I the only one who read "haughty sniping" as "freakin' campers?"

      --
      You have two hands and one brain, so always code twice as much as you think!
  9. Re:Translate this: by tomhudson · · Score: 3, Funny
    No, you've got it all wrong:
    IF: subject of new article is same as previous article
    THEN: Post, baby, post!
    ALSO: Fire person who bothered to check for dupe post, as they do not meet slashdot's editor requirements.
    I know that code is in there somewhere ...
  10. Bad English?!?!? by mlopes · · Score: 3, Funny

    Shiver Me Timbers and Poke Me Other Eye Out! How would it handle this!?

  11. Have Kylie stripped washed and brought to my tent by Timesprout · · Score: 4, Funny

    waiting...
    waiting...
    waiting...

    Stupid computer doesn't do anything I tell it

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
  12. I don't think so by gowen · · Score: 4, Funny
    Computer programming is second nature to most of the Slashdot crowd
    Spoken like a man who's never looked at SlashCode.
    --
    Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
  13. Thanks a lot. by CDarklock · · Score: 2, Funny

    Now that I've seen that, I suddenly have to wrestle with the fundamental insanity of having FOND MEMORIES about COBOL.

    Why couldn't you have just left well enough alone, so I could keep happily despising it?

    Next thing you know, I'll be pining away for OS/390 JCL.

    --
    Microsoft cheerleader, blue flag waving, you got a problem with that?
  14. Re:Ebonics? by Gzip+Christ · · Score: 5, Funny
    Hey brudda, how long beefo it be talkin ebonics yo?
    There is already a programming language for programming in Ebonics. Be sure to check out some of the sample programs - they are true masterpieces.
  15. Re:Oh, great... by Taladar · · Score: 2, Funny

    Anyone who had never even watched someone cook something for a few hours and just knows the names of the meals that taste best but doesn't even know the names of all ingredients or how they look raw should be denied access to a stove, yes.

  16. Re:With All Due Respect... by Alien+Being · · Score: 3, Funny

    "I wish that people spoke mathematically rather than poor and ambiguous languages"

    You fail it.

  17. Code Complete by simpl3x · · Score: 2, Funny

    Is this perhaps an extreme example of building code from language, which is perhaps notoriously sloppy? I just gave my son an old copy of Code Complete so that he could learn to go from what he wants to do to code, all while developing documented code. He is in the introductory C++ programming class. He has a professor asking him to draw flow charts.

  18. Update by Espectr0 · · Score: 5, Funny

    Update For for the dupe. Not going well. Appreciate all the hate mail. Really encourages improvement.

    Ah, yes! Duping words next to each other, that is the new fad. Because duping articles is so yesterday's news

  19. Re: Hate Mail by zuvembi · · Score: 2, Funny

    Well, nothing else seems to improve their editing style, grammar or general editing skills, so I really don't see why they don't expect hate mail.

    It certainly would help if there was some transparency in their processes.

  20. Re:Other uses? by Anonymous Coward · · Score: 1, Funny
    ERROR (line 9): Capacity not specified;
    ERROR (line 11): Duplicate resources found, type specifier not present;
    ERROR (line 22): Utensil not specified;
    WARNING: Oven resource never closed;
    WARNING: Oven resource never turned off;
    WARNING: Pan never removed from oven;


    ... etc.

    Plus you forgot to mark your eggs for garbage collection once you were done with them. ;)
  21. Re:Dupe by phasm42 · · Score: 4, Funny

    I like how he duped the word "for" in his comment: Update for for the dupe.

    --
    "No one likes working in a hamster wheel, and your shop smells of cedar shavings from here." - TaleSpinner
  22. Re:Dupe by poot_rootbeer · · Score: 3, Funny

    Update For for the dupe. Not going well. Appreciate all the hate mail. Really encourages improvement.

    I fed this text into Metafor and it core dumped on me!

  23. Re:Very Cute by Harassed · · Score: 2, Funny

    I'm afraid that your code infringes my patent #3254324 "Method of writing computer code using ASCII characters so that they can be displayed on an internet site"

  24. Use enums instead by Chemisor · · Score: 1, Funny
    If you had used an enum instead of those constants, the compiler could have checked the argument validity at compile time:
    enum EDirection {
    RIGHT,
    LEFT,
    UP,
    DOWN
    };

    void changeDirection (EDirection dir)
    {
    direction = dir;
    }
    That is, unless you are using Java, in which case: oh, you poor shmuck! :)
  25. Re:Dupe by TheDauthi · · Score: 2, Funny

    I'm sorry, I've already patented that software. My army of lightly-armed attack lawyers will be there shortly.

  26. Clippy by bar-agent · · Score: 3, Funny

    Have Kylie stripped washed and brought to my tent

    "It looks like you want to strip-wash Kylie. Now readying strip-washer, copper surfacer, and metal shearer. Thank you for using Metafor."

    --
    i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]