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.

20 of 475 comments (clear)

  1. Usefulness by suso · · Score: 5, Insightful

    Well, I doubt something like this would be used to write the next version of Gimp, but I can see its use in helping people to convey what they want a computer to do. Few people need to write programs and I don't know whether I'd want people who don't
    understand computers to actually write them. But it would help when someone wants to make something like a 3D scene in Blender. It reminds me a lot of that episode of STTNG (Schizims) where Riker, Troy and Worf are telling the computer to replicate an alien room that they were in.

  2. Very Cute by AKAImBatman · · Score: 5, Insightful

    While this is a cute concept, I don't think you'll be seeing computer programmers disappearing any time soon. The natural language bent was the original point of high level languages. Early languages like COBOL, SNOBOL, and BASIC were all designed to abstract programming to a level of natural language. Save for BASIC's success as a beginner's language, none of them accomplished their goal. In fact, the "natural language" design of COBOL only served to complicate the language and cause a variety of errors due to missing periods, improper spacing, and other common typing mistakes.

    It wasn't long before it was reul languages actually broke away from English and relied more heavily on easily-parsable, special characters to define structure. We can see the results of this in today's C/C++, Java, LISP, PERL (bleh), and Python languages. This new interface does nothing but try to perform some of the structural thinking done by the programmer. (Although I have my doubts as to its current real world ability.)

    So the question that then comes to bear is, "Who would use this natural language interface?" Sadly, the answer is most likely "programmers". But why would a programmer use this interface if he has to be trained in computer logic in the first place? It would seem like an unnecessary level of abstraction that would only serve to hinder a programmer's natural abilities.

    Of course, there is the documentation issue. Supposedly this interface will be useful for producing requirements in addition to code. But who produces the requirements? Not the programmer. That's usually the job of the business analyst, someone who may not even have experience with coding logic. And for code documentation, nothing quite beats the JavaDoc style documentation that has become popular in the last few years.

    I think that research like this is interesting, but I doubt it will have many uses until AI and voice recognition improves to a level similar to that seen in Star Trek. Only about 300 more years and counting. ;-)

    1. Re:Very Cute by krgallagher · · Score: 3, Insightful
      "But who produces the requirements? Not the programmer. That's usually the job of the business analyst, someone who may not even have experience with coding logic.

      Yeah that is what I was thinking. For this to be usefull, the requirements have to written in a format that mirrors programming logic. If you are not a progrmmer, you probably do not think in that kind of logic. That is why most the the requirements documents I see are incomplete and open to interpretation.

      --

      Insert Generic Sig Here:

    2. Re:Very Cute by ArsonSmith · · Score: 3, Insightful

      I want to do this backwards. Can I feed it source code and have it output natural language?

      --
      Paying taxes to buy civilization is like paying a hooker to buy love.
  3. Doomed to failure by rde · · Score: 4, Insightful

    I don't mean to sound pessimistic, but remember who comes up with functional specs; managers. As a consequence, this poor program may well come up with a framework that matches exactly what was requested, but once it's put together, the suits will say "it doesn't do this". When it's pointed out that that wasn't in the spec, the inevitable response will be "but it was implied; it should be obvious that we'd need it to do that." This is just a core dump waiting to happen.

  4. With All Due Respect... by schestowitz · · Score: 4, Insightful

    I wish that people spoke mathematically rather than poor and ambiguous languages that can now (supposedly) turn into (ambiguous) code. Can one really rely on translated 'code' like this. That's like sending an E-mail from speech-to-text recognition without proof-reading.

    --
    My Linux - (L)ove (I)s (N)ever (U)tterly eXPensive
  5. the old is new again by dubl-u · · Score: 4, Insightful

    While the logic of the researchers' interpreter tackles only about 20 percent of the problem of full natural language programming, it achieves about 80 percent of the perceived rewards.

    Ah, this old thing again.

    The hard part about programming isn't turning basic English text in to half-assed code. If it were, then Google have built their company on just-out-of-college scripters and Visual Basic.

    [Liu says] "Many subjects immediately identified the simplistic interpretation of the interpreter, and wanted the opportunity to rephrase their original wording to fix the error."

    Yes, regular English is insufficient for programming. If a tool like this becomes popular, you'll need still need a special class of people to figure out what is needed and to figure out how to phrase the desire in the precise way that makes this guy's interpreter actually do what they want.

    In other words, he hasn't invented a way to eliminate programming or programmers. He's figured out a way to make a programming language that is slightly easier to learn at first. But because it's removed from what computers actually do, much harder to use for anything serious. The hard part about programming isn't the month you spend learning Java syntax, it's the many years you spend learning to write code well.

    Their theory appears to be that this will make programming easier to learn. I wish them the best of luck in that goal, but having seen over the years a number of graphical and natural-language programming tools vanish without a trace, I'm not holding my breath.

  6. What about the other way around by El+Cabri · · Score: 4, Insightful

    Firstly, people for whom programming is too complicated should not code at all. We need less programmers building better code, not more programmers adding to the crap heap that the software legacy is as of today.

    Secondly, I think that what is needed is the other way around : automated analysis of code and production of natural language reports that designers could browse more easily than the code itself looking for bugs or designing extensions and additionnal feature. They would then intervene directly on the code itself.
    Sort of a souped up version of Knuth's literate programming, only with a much more radical transformation of the code for its vizualisation, bringing up the essential and critical aspects.

    Think of how a reasonably complicated mathematical proof, say within the formal set theory, would look like in a math paper or book meant to be read. Compare with how it would be coded in a theorem prover. Different. Yet the former can be automatically generated from the later.

  7. Re:Dupe by FortKnox · · Score: 5, Insightful

    No fears, he's issued an update:

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

    Nice. Someone should go to customer service 101 and grow up a little. Yelling at the people who (indirectly) line your wallet. Not a good idea....

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  8. Poor Taco by p3d0 · · Score: 5, Insightful
    Update For for the dupe. Not going well. Appreciate all the hate mail. Really encourages improvement.
    All together now: "Aaawwwwwwwww".

    I've never been one to complain about dupes. I figure I already get way more than I pay for from this site (which is zero). But if people are frustrated about dupes, maybe it's because it's an exceedingly simple problem to solve, and the Slashdot editors give every appearance of not bothering to lift a finger to solve it.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  9. Re:Dupe by FortKnox · · Score: 4, Insightful

    To actually add content to my content:

    How terribly difficult would it be to add a url checker. I can understand a dupe when its an article written differently by two publications, but a simple URL checker can state "this url was used in store XYZ [with link]," so the editor can determine if its a dupe story or just a url used in two different stories...

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  10. About your update, Taco by festers · · Score: 5, Insightful

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

    Taco, you asshole, you've been duping stories for years. You've known about them and yet you've done nothing to fix the problem. Don't pull this sentimental BS about not "encouraging" improvement. If the fact that if Slashdot is your creation, and is your job, isn't enough "encouragement" for you to fix the problem of dupes, I don't think anything will be. From all appearances, it looks like you've given up on /. years ago.

    --


    -------
    "Every artist is a cannibal, every poet is a thief."
    1. Re:About your update, Taco by exp(pi*sqrt(163)) · · Score: 5, Insightful

      Maybe he could just tell us what does encourage improvement. Sending fan mail every time a story that isn't a dupe is posted?

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  11. Re:Dupe by 1u3hr · · Score: 5, Insightful

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

    Is he drunk or something (For for??) At least we know he reads the hate mail, so send more. Ignoring stupid avoidable fuckups certainly doesn't work.
    They can either
    1) implement a simple function that compares the main words in the article with recent ones, particularly URLs (ignoring some obvious generic ones, like the home page of newspapers). (For extra credit, spellcheck the fucking thing, and check that any URLS exist.)

    2)Read the mail that comes in from subscribers telling them they've duped (apparetly that's mostly ignored; when I send it in it often bounces, some editora apparently have invalid forwardnig addresses)

    3)Or use their own brains and just type one relevant word into the Slashdot search box:
    Search 'metafor'
    Metafor: Translating Natural Language to Code
    On March 30th, 2005 with 170 comments
    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...

    English To Code Converter
    On March 26th, 2005 with 52 comments
    prostoalex writes "Metafor from MIT is a code visualization utility, capable of converting high-level descriptions into class and function (or method...

  12. Dupe checking is a not a technical problem. by Inoshiro · · Score: 4, Insightful

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

    At LWE in January, 2001, at a conference on Slashcode, someone asked us at Newsforge how our site had so few dupes compared to Slashdot. There were two reasons:
    1) We had a smaller audience of people to see the dupes we did accidently post.
    2) We searched our archives before posting any story. We searched by story URL, by story keyword. We also generally skimmed the site when we weren't working to be aware of what was being posted.

    Clearly, #1 is something Slashdot doesn't have working in its immediate favour, but #2 is something that shouldn't be too hard. Zonk, Timothy, Cliff, Simonker, etc, don't post dupes nearly as frequently as CmdrTaco. Hemos doesn't post often, but he also seems to be pretty dupey (understandable as he's not really associated with /. anymore, and wouldn't be familiar with what's been posted).

    The worst example is something like the PSP dupe story: Taco didn't even check out the games section, which had that story right at the top! A simple search for "PSP" and "Browser" would've shown it even if he never reads sections.

    CmdrTaco doesn't read his own site. What does this tell you about how he feels about it?

    I don't read Kuro5hin much anymore for the same reason. Complaining about dupes will just drive him further away, even though he still has to work on it by contract.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
  13. It's actually sorta important! by SPYvSPY · · Score: 5, Insightful

    It really bugs me that /. editors treat dupes as a sort of charming fact of life, as if dupes are among those imperfections that make life worth living. Dupes suck, if for no other reason, because they fork discussion, confuse the archive and make searches less precise.

    It's especially annoying when the dupe article proclaims that the /. crowd is able to code by second nature. How f-ing hard is it to have a dupe checker (even a simple on like what FortKnox is proposing). Why is it that a website that proclaims itself the bastion of all things FOSS has languished in mediocrity while thousands of competent coders are practically begging to write this feature into the site's backend? Of course, nothing will come of this, except more shoulder-shrugging and gee whiz, golly nonsense. I'm not trying to flame, but this sort of unprofessional, "friendly fuckup" attitude is what holds the public image of FOSS back.

    1. Re:It's actually sorta important! by Elwood+P+Dowd · · Score: 3, Insightful

      Why is it that a website that proclaims itself the bastion of all things FOSS has languished in mediocrity while thousands of competent coders are practically begging to write this feature into the site's backend?

      We don't have to beg. We can just submit a patch to slashcode.

      --

      There are no trails. There are no trees out here.
    2. Re:It's actually sorta important! by dmd · · Score: 5, Insightful

      The point is that such patches have been submitted, by dozens of people - people who are very talented, and who have a great deal of experience running and modifying Slash.

      Slashdot is not interested in applying these patches, because dupes mean more angry posts, and angry posts mean more pageloads, and more pageloads mean more ads served.

  14. Re:Dupe by snorklewacker · · Score: 5, Insightful

    > How terribly difficult would it be to add a url checker

    These are paid editors who can't be bothered to read their own website. The problem is not technological, and doesn't require a technological fix.

    --
    I am no longer wasting my time with slashdot
  15. Lazy admins by DogDude · · Score: 3, Insightful

    No, an url checker isn't needed. They need to actually do their fucking jobs. Hell, I just read the site, and I know when a story is a dupe, as do hundreds of other readers. For a few of these guys, their ONLY JOB is to maintain the site. If they can't recognize when a story is a duplicate, they aren't doing their job. It shouldn't require an URL checker. These guys should get off their lazy asses. The problem is that some of us just keep coming back, giving them more pageviews, etc. If people got really sick of it and just came to /. less, maybe management would wake up and can these guys posting the stories. Sure, I know they started it, but that doesn't mean they're inherently more competent than anybody else.

    --
    I don't respond to AC's.