English To Code Converter
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."
Shooting yourself in the foot (in Metafor):
"Shoot yourself in the foot."
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."
"What do you think?" "I think 'What, do you think?!'"
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...
This space intentionally left blank.
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.
Unknown host pong.
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.
Spencer Ogden
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!"
Hero of Allacrost, a FOSS RPG for *NIX/*BSD/OS X/Win
Isn't this just the New Cobol?
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
perl -e "eval pack(q{H*},join q{},qw{70 72696e74207061636b28717b482a7d2c717b343 637323635363534323533343430617d293b})"
This Web site has more useful information and better pictures
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.
Microsoft cheerleader, blue flag waving, you got a problem with that?
I'll be impressed when Metafor can be written in Metafor.
Until then, I'll just use whatever language they're using!
Yup, they're called "programmers".
The Army reading list
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.
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
Don't think that a small group of dedicated individuals can't change the world. It's the only thing that ever has.
If the University of Kentucky of something finds the secret of sentience, it'll probably go unnoticed. Until MIT or Stanford comes upon it.
Transcend Humanity. Please.
It sounds like yet another reinventing of Literate Programming and The CWEB System of Structured Documentation by Donald E. Knuth. See also: www.literateprogramming.com. Some quotes:
More quotes:
In other words, paraphrasing Henry Spencer, "Those who do not understand the ideas of Donald Knuth are condemned to reinvent them, poorly."
Sincerely,
Pan Tarhei Hosé, PhD.
"Homo sum et cogito ergo odi profanum vulgus et libido."
Whoa. I entered "fuck you", and you won't believe the C I got back.
Table-ized A.I.
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.
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?
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). 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?
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 you go backward from finding a problem in the running program to the conceptual problem in your high-level thinking? Perhaps this is easy for people who are already programmers, but for the supposed audience for stuff like this, that's the most difficult thing of all.
Turning input into some arbitrary computer program isn't interesting. Helping programmers to reason about programs is. That means tools that aren't just one-way translations.
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 accepted syntactic subset will likely be interpreted different than is expected. It's the development equivalent of the uncanny valley. It seems like a good idea, but it's only going to make things worse before it makes things better.
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: _
Why not fork?
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.
--
make install -not war
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.
I wonder if the MIT researchers would be willing to ride on the first test flight?
There is some related work which I find much more convincing. It's the work on Grammatical Framework (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.
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.
You make a very good point. By using a specialized subset of english, the system could be excluding many more people than an ordinary programming language. This kind of thing could end up as tricky as legalese.
What keeps me going is my inertia.
COBOL.
Welcome to 1959!
Is Capitalism Good for the Poor?
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.
Benjamin Arai http://www.benjaminarai.com
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.
Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
...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.
If my grammar and spelling are off, I am [distracted/tired/careless] (take your pick)
Who on the internet even speaks proper english anymore?
Last I checked, we have this language that goes something like this:
"HAY GUYZ!!!!1!! can sum 1 t3ll m3 ur ASL??!?!?!
LOLOL KTHX HARBL!!"
If the computer starts interpreting natural language, then what's our job? -- "Don't allow others know you are useless" --