Live data from Hacker News

Generating code from natural language is closer than you think

blog.stephenwolfram.com

81–83 of 83 posts

Re: Generating code from natural language is closer than you think

#81

This will exactly end like Infocom adventures. They are mostly nice, but quite often you hunt for the exact phrase the parser understood (but to be fair, it happened more often in Magnetic Scrolls). But would you call using a text adventure (put blue ball in red box) programming?

I was thinking the same thing. And it's no coincidence that Inform 7 -- the latest iteration of a popular text adventure game programming language -- is perhaps the most extreme example of a programming language pretending to be English.

Here's the actual source code of a game: http://inform7.com/learn/eg/bronze/source.html

Of course, it's really a precise programming language that happens to read like English; the same text might not work if it were rearranged into semantically equivalent English.

Re: Generating code from natural language is closer than you think

#82
post #46

Sure, by the time you enter all the specifics of the Circle, you've got something more unwieldy than a succinct programmatic description. But for most people unfamiliar with Mathematica syntax, typing, "draw a red circle" and having the computer choose sensible (or any) defaults yields a template of the exact code one would have needed to type. Which saves Googling or reading the manual for circles, and teaches the s…

That is correct...it is nice to be able to see the underlying Mathematica code that any natural language query generates. Here's your "draw a red circle" example:

http://img502.imageshack.us/img502/4355/drawaredcircle.png

Re: Generating code from natural language is closer than you think

#83
post #78
post #47

"Make it possible for programmers to write in English and you will find the programmers cannot write in English." I teach computer science and have a particular fondness for introductory CS. The reason Stephen Wolfram is wrong, wrong, wrong about this is that people that have never been taught programming can't express themselves precisely enough in their native language, either; and even among those of us that have…

The problem with this analysis is that it discounts the possibility of interactivity. There are many who cannot think through the logical steps needed to complete a task, but can watch a system stepping through a task, stop it when it seems to go wrong, and provide an explanation as to what's wrong about it. There are a whole lot of problems for which this trial and error process would converge to a mostly working so…

I have no problem with this idea of iterative refinement, and indeed I actively teach it. There are certainly students who pick up the syntax more slowly, but this is largely a matter of degree. But the students I refer to above have trouble even identifying what's wrong about an intermediate value or where things went off the rails or what a correct answer would even look like. They're more common than you (as a hacker) would ever believe unless you teach intro CS. They can be taught at least enough to pass CS1, but it's not easy and "natural language programming" will not help them with the things they need help on. (Might actively hurt, actually.)
Post reply on HN