Live data from Hacker News

Generating code from natural language is closer than you think

blog.stephenwolfram.com

51–60 of 83 posts

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

#51
post #22

Earlier quoted context omitted.

there is no obvious convention for visual commands or visual conditionals I don't know about that. Within a particular domain, you can certainly come close to representing these things, or presenting the right controls for a user to represent commands and conditionals. For an example, check out QuickFuse http://quickfuseapps.com Before we built this, we thought about common ways people "drew" voice apps, and commands…

The convention is arbitrary (e.g. most people don't have receivers on their phones and hanging up is done by pressing down a button not by placing the receiver in a horizontal position). If there were an obvious visual convention, the start button would not need to say "start" and the hang up button would not need to say "hang up." That's not to say that arbitrary visual conventions can't have great utility (the alph…

Why would you exclude text labels from visual programming? I think this is an artificial distinction. Sometimes they provide the best balance of space consumption vs. clarity. Labels on their own aren't natural language, they are at most terms put into context by the surrounding graphics; would your criteria be that visual programs use icons for every single concept?

Also, you'll find that that where we departed from conventions for flowcharting, we did it to save pixels, or make the UI more accessible. There is a tradeoff in visual programming between ease of editing and clutter--compare with Max MSP, which has a stark UI, at the cost of having you memorize certain textual commands. If you draw a bare flowchart, it's not obvious how to manipulate it until you draw other GUI controls on top of it or make some modifications. However, it is the general paradigm we are tapping into.

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

#52
post #15

Earlier quoted context omitted.

Where is the red circle drawn? How large is it? What shade of red? How are those arbitrary values chosen, and how do I choose others? The inherent problem with NLP is that human languages are imprecise and ambiguous. For an example of the problems with NLP, try using Wolfram Alpha. While it returns useful results for many queries, as soon as you start off the beaten path it can become an exercise in frustration as yo…

> Where is the red circle drawn? How large is it? What shade of red? How are those arbitrary values chosen, and how do I choose others? http://www.wolframalpha.com/input/?i=draw+a+red+circle

I was expecting it to be filled with red, not just have a very thin red border.

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

#53
I'm suspecious of the usefulness of such an approach.

What's easier, "5 + 10" or "five plus 10", or even worse "five added to ten"?

Dijkstra had an article about that, titled: On the foolishness of "natural language programming"[1].

[1]: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EW...

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

#54
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…

Sorry, my fat thumb downvoted you on the iPhone

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

#55
Two reactions to this piece.

1. I'm not sure what problem so-called natural language programming is trying to solve.

2. Though I admire this man's building of Mathematica and the company that sells it, I'm generally not a fan of what I perceive as his history of "discovering the obvious" and self-promotion. Or rather, rediscovering or making things sound like he invented them or came up with them for the first time. Cellular automata and it's implications in his book "A New Kind of Science", and now this piece sounds like more of the same. I give him a little slack because he's in business and so there's the self-promotion angle, but not much.

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

#56
post #52

Earlier quoted context omitted.

> Where is the red circle drawn? How large is it? What shade of red? How are those arbitrary values chosen, and how do I choose others? http://www.wolframalpha.com/input/?i=draw+a+red+circle

I was expecting it to be filled with red, not just have a very thin red border.

http://www.wolframalpha.com/input/?i=draw+a+red+filled+circl...

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

#57
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…

Agreed. Take any of the modern mainstream languages like Java or Python, for example. If you were to describe them to a non-programmer who didn't know what a programming language was, or why it was needed, you might say something like, "Well, they look a little like English and they use some of the same words from English. But they have very precise meanings which are not exactly the same as in English, and you can put them together in ways which are different than English, and the reason why is to be much more precise and explicit and concise than what you could do in English. And because a programming language has nothing to do with emotions or conveying concepts but instead in purely carrying out a sequence of steps and manipulating and storing data. That's it." In other words, their designer's started with a natural human langauge, then left out the parts that were irrelevant to the computer, then zoomed-in on and enhanced the richness of the expression capabilities when it comes to certain other areas. They threw out the bathwater and made the baby bigger and better! In other words, they were designed starting with the premise (or perhaps it was a conclusion you reach along the way) that so-called natural language programming is pointless or inefficient, and so they want and made another kind of programming, which worked much better. Their requirement was to make a machine that propels itself under water. They knew they were going to call it a submarine. They realized early on there was no need to make that submarine "swim" like a human. They just added propellors and rudders, etc. Making a submarine "swim" was irrelevant. It just had to move through water.

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

#58
post #15

Earlier quoted context omitted.

Where is the red circle drawn? How large is it? What shade of red? How are those arbitrary values chosen, and how do I choose others? The inherent problem with NLP is that human languages are imprecise and ambiguous. For an example of the problems with NLP, try using Wolfram Alpha. While it returns useful results for many queries, as soon as you start off the beaten path it can become an exercise in frustration as yo…

Draw a circle. Color it red. Make it smaller. No, 5% bigger. Make the radius 5 units. Refining specifications like that seems like the holy grail of movements like aspect-oriented programming, NLP or no. Separating concerns is a really good thing.

  circle = Circle(); // default origin, radius, color, etc.
  circle.set_visible(true)
  circle.color = RED
  circle.make_smaller()
  circle.set_radius(5)
// or whatever. just saying we can do approximately this already today, in most any modern language, as long as you're willing to express it in the prog language rather than the natural language. And I'm not sure having it expressed in a natural language is better in any significant way.

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

#59
Sure, right after physics is adequately expressed in natural language.

There's a reason physicists express their concepts in mathematics, and that's because math is the language humans devised to express those things, having found natural language inadequate.

Programming is similar in that regard.

Post reply on HN