Live data from Hacker News

E.W.Dijkstra: On the foolishness of "natural language programming"

cs.utexas.edu

11–20 of 71 posts

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#11
post #4
post #3

Earlier quoted context omitted.

This man knows about programming languages way more than most of us. Listen to him. I bet it isn't the first time he has this discussion. See: Algol, Ada and others.

It's often the foolhardy and the ignorant that tackle problems that are supposedly impossible. And sometimes end up succeeding. Wisdom is certainly something to take from, but embodying the limits imposed by someone as a roadblock to onself isn't the way to innovation.

Let's suppose it's a really easy problem to solve.

Why the hell would anyone want to program in a natural language?

Suppose you could write a kernel in such a language, and one of the instructions was:

"Load the first 5 bits at address 0x323abc into the last 5 bits after address 0x89bbca"

Now, wouldn't it be easier to say 'shuffle_bits(5, 0x232abc, 0x89bbca);' where you control precisely what 'shuffle_bits' does?

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#12
post #11
post #4

Earlier quoted context omitted.

It's often the foolhardy and the ignorant that tackle problems that are supposedly impossible. And sometimes end up succeeding. Wisdom is certainly something to take from, but embodying the limits imposed by someone as a roadblock to onself isn't the way to innovation.

Let's suppose it's a really easy problem to solve. Why the hell would anyone want to program in a natural language? Suppose you could write a kernel in such a language, and one of the instructions was: "Load the first 5 bits at address 0x323abc into the last 5 bits after address 0x89bbca" Now, wouldn't it be easier to say 'shuffle_bits(5, 0x232abc, 0x89bbca);' where you control precisely what 'shuffle_bits' does?

Obviously you wouldn't write kernels. You would write the equivalent of shell scripts for ordinary users. Imagine if ordinary users could automate their daily workflow or customize MS Word as much as vim or emacs users do with their editors.

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#13
post #10
post #8

Earlier quoted context omitted.

> Why should we not alter our "natural", i.e. legacy based, communication when dealing with computers? Or when dealing with each other, for that matter. In Lojban, it is grammatically incorrect for someone to give me vague directions like "we are at the pub to the left of the central plaza". They would instead have to say something like "we- not-you are now at the only pub to the left ( when seen from the cinema ) of…

> of the only plaza Which plaza? Just because you said "the only plaza" doesn't make it unambiguous. There certainly exist more than one plaza in any given city.

"The only plaza" is either unambiguous (in cities with one plaza) or incorrect (in cities with multiple plazas). Just because a language makes it impossible to be unambiguous doesn't mean it makes it impossible to be wrong.

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#15
post #11
post #4

Earlier quoted context omitted.

It's often the foolhardy and the ignorant that tackle problems that are supposedly impossible. And sometimes end up succeeding. Wisdom is certainly something to take from, but embodying the limits imposed by someone as a roadblock to onself isn't the way to innovation.

Let's suppose it's a really easy problem to solve. Why the hell would anyone want to program in a natural language? Suppose you could write a kernel in such a language, and one of the instructions was: "Load the first 5 bits at address 0x323abc into the last 5 bits after address 0x89bbca" Now, wouldn't it be easier to say 'shuffle_bits(5, 0x232abc, 0x89bbca);' where you control precisely what 'shuffle_bits' does?

    copy the time field from cpuinfo to temp_time'
    backup the low 5 bits of goodnameformemorylocation'
    locA's low 5 to locb's low 5'
Seems like there are a fair number of nice representations. Context is obviously important though: in a kernel, you probably want fairly implicit ways of referring to bits.

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#16
post #13
post #10

Earlier quoted context omitted.

> of the only plaza Which plaza? Just because you said "the only plaza" doesn't make it unambiguous. There certainly exist more than one plaza in any given city.

"The only plaza" is either unambiguous (in cities with one plaza) or incorrect (in cities with multiple plazas). Just because a language makes it impossible to be unambiguous doesn't mean it makes it impossible to be wrong.

perhaps, you might say 'the assumed plaza' for explicit-ambiguity?

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#17
post #10
post #8

Earlier quoted context omitted.

> Why should we not alter our "natural", i.e. legacy based, communication when dealing with computers? Or when dealing with each other, for that matter. In Lojban, it is grammatically incorrect for someone to give me vague directions like "we are at the pub to the left of the central plaza". They would instead have to say something like "we- not-you are now at the only pub to the left ( when seen from the cinema ) of…

> of the only plaza Which plaza? Just because you said "the only plaza" doesn't make it unambiguous. There certainly exist more than one plaza in any given city.

> Just because you said "the only plaza" doesn't make it unambiguous.

That was just me compressing it to fit somewhat into English. What it really would say is "the only plaza which fits the current context", as opposed to e.g. "the specific place called The Plaza" or "the only plaza in the universe".

The specific Plaza change wasn't the intended point, though. The "to the left of X while standing at Y" as opposed to "to the left of X" is the biggest clarity gain.

It is obviously possible to express ambiguity in any language, even Lojban, but you have to work harder for it.

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#18
post #17
post #10

Earlier quoted context omitted.

> of the only plaza Which plaza? Just because you said "the only plaza" doesn't make it unambiguous. There certainly exist more than one plaza in any given city.

> Just because you said "the only plaza" doesn't make it unambiguous. That was just me compressing it to fit somewhat into English. What it really would say is "the only plaza which fits the current context", as opposed to e.g. "the specific place called The Plaza" or "the only plaza in the universe". The specific Plaza change wasn't the intended point, though. The "to the left of X while standing at Y" as opposed to…

How exactly is that any different from "the plaza"?

What's even "the current context"?

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#19
post #16
post #13

Earlier quoted context omitted.

"The only plaza" is either unambiguous (in cities with one plaza) or incorrect (in cities with multiple plazas). Just because a language makes it impossible to be unambiguous doesn't mean it makes it impossible to be wrong.

perhaps, you might say 'the assumed plaza' for explicit-ambiguity?

Ah, yes. That is actually what the Lojban sentence would have said. My "translation" of that part was a bit off.

Re: E.W.Dijkstra: On the foolishness of "natural language programming"

#20
post #14

Funny, I just read this — http://blog.stephenwolfram.com/2010/11/programming-with-natu...

And an analysis of Wolfram Alpha from a viewpoint similar to Dijkstra's: http://unqualified-reservations.blogspot.com/2009/07/wolfram...
Post reply on HN