Live data from Hacker News

The English-Likeness Monster Stalks a New Generation of Programmers

raganwald.posterous.com

51–60 of 78 posts

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#51
post #41
post #33

Earlier quoted context omitted.

Another amateur linguist + software dev here (loosely involved in NLP-related work and studied linguistics at university). I invite you to try to convince me that there might possibly be a natural-language-esque version of the (in)famous inverse square root function that is more comprehensible than the original. float Q_rsqrt( float number ) { long i; float x2, y; const float threehalfs = 1.5F; x2 = number * 0.5F; y…

I think you're missing the practical use cases of natural language programming, at least those in the next decade or so. "Hello Computer! I need an inverse square root function. It should take a float as a parameter and..." - Not practical "Hello Computer! I need this image to pan across the screen. It should take one second. When it gets there, I want it to stop and become clickable. When you click it..." - Very pra…

I can't help but sense this leading right back to the bad old days of PowerBuilder and Visual Basic. The whole idea behind 4GLs was, you "tell" the computer what you want it to do in high-level concepts. The problem is the 90% of the program it makes easy is was easy before, and the 10% that remains is effectively impossible for the non-programmer, and the programmer will balk at all the extra work they have to do to squeeze it in.

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#52
post #33

I actually disagree to some extent with Raganwald here. I am both a software engineer and an amateur linguist. Let me try to go into where my disagreement is. I figure that someone, probably me, will have to set the record straight about how poorly our expectations of English grammar match the realities and utilities of this language.[1] Natural languages and computer languages are very different both in how they are…

Another amateur linguist + software dev here (loosely involved in NLP-related work and studied linguistics at university). I invite you to try to convince me that there might possibly be a natural-language-esque version of the (in)famous inverse square root function that is more comprehensible than the original. float Q_rsqrt( float number ) { long i; float x2, y; const float threehalfs = 1.5F; x2 = number * 0.5F; y…

This is the best, most succinct and apt summary of the situation I've ever seen: "I contend that there is no sufficiently high level of abstraction where natural language would be more suitable."

I'm reminded of Paul Graham's remark about Prolog being more high level but not more terse, and that this had something to do with its present-day situation. Natural language is high level because it is terse and humans can supply a great deal of omitted information on their own. Teaching the computer how to supply that information is an incredibly error-prone burden. Teaching people how to use precise English seems to be worse than teaching people how to use a precise language that isn't English.

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#53

I actually disagree to some extent with Raganwald here. I am both a software engineer and an amateur linguist. Let me try to go into where my disagreement is. I figure that someone, probably me, will have to set the record straight about how poorly our expectations of English grammar match the realities and utilities of this language.[1] Natural languages and computer languages are very different both in how they are…

All right. I program and I speak English all the time, how's that for credentials?

I mean this in the nicest possible way but this is like saying a whole lot and nothing at the same time. I think if I heard this as a verbal response to the original article, I would think the speaker just wants to hear himself speak.

You haven't really stated counter point by which to justify any kind of disagreement. It's seems to be like a promissory note of "well if the language conformed to some subset dialect like legalese that could be great." I think there are very big problems for English-like programming languages that this sort of skirts over and dismisses. Just because you think people that think a phrase like "Me ain't got no dollas" is horrible grammar are just fuddy duddy "prescriptivists" doesn't really solve the problem of English-like programming languages.

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#54
post #33

Earlier quoted context omitted.

Another amateur linguist + software dev here (loosely involved in NLP-related work and studied linguistics at university). I invite you to try to convince me that there might possibly be a natural-language-esque version of the (in)famous inverse square root function that is more comprehensible than the original. float Q_rsqrt( float number ) { long i; float x2, y; const float threehalfs = 1.5F; x2 = number * 0.5F; y…

My point is that one doesn't use a natural language to get the job done, one uses a computer language in the likeness of a natural language to get the job done. The similarity speeds learning process. As for an example, you just gave one. But if we wanted to make it more natural-language-like it would be a slightly different syntax: DECLARE FUNCTION q_rsqrt (float number) THAT RETURNS float AS ( .... ); Now if you th…

I wouldn't say that is "natural language like." I would just say that is a very loquacious programming language. I contend the C equivalent of that is more readable. You're using the same sort of constructs in typical programming languages but still lacking anything like the kind of fluid reading and understanding one would expect from the promise of English like programming languages.

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#55
post #39

OK, maybe writing arbitrary English as a program won't work; but, I can think of a lot of occasions where it would be useful for a computer program to be understandable by any English speaker. I'm thinking of lawyers, who want to be able to review whether a program conforms with legal requirements, or managers, who want to be able to confirm that business logic is doing what they want it to do. Zed Shaw kind of hints…

No, to be honest they should just learn to program then. Maybe what you're talking about would be great if all programs were 100 line simple things but that's not reality. If we want to solve the "lawyers need to read and understand computer programs for legal reasons" problem, it makes more sense to just educate lawyers on programming. In some ways this is like saying lawyers need to be electrical engineers, civil engineers, etc. We need physics to more Englishy and less Mathy. :) I jest but I'm serious. For business rules, perhaps this simple case could be expressed with a specialized DSL or config depending on your needs but I think this is a little tertiary.

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#56
Reminds me of the "death of programmers" that I've been hearing is right around the corner for that last 3 decades. You know, computers will understand what you want and just do it. Except that 90% of programming is not translating ideas into computer cyphers, it's figuring out (or guessing at) what the user really wants.

For example, what should happen if the network drops out in the middle of a save? Should it save a copy locally? Where? No, not the temp directory; that will be erased if the computer is rebooted. And so on.

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#57
post #33

Earlier quoted context omitted.

Another amateur linguist + software dev here (loosely involved in NLP-related work and studied linguistics at university). I invite you to try to convince me that there might possibly be a natural-language-esque version of the (in)famous inverse square root function that is more comprehensible than the original. float Q_rsqrt( float number ) { long i; float x2, y; const float threehalfs = 1.5F; x2 = number * 0.5F; y…

My point is that one doesn't use a natural language to get the job done, one uses a computer language in the likeness of a natural language to get the job done. The similarity speeds learning process. As for an example, you just gave one. But if we wanted to make it more natural-language-like it would be a slightly different syntax: DECLARE FUNCTION q_rsqrt (float number) THAT RETURNS float AS ( .... ); Now if you th…

The method signature is the low-hanging fruit. Try the method body.

ADD: Do you accept that programming has its basis in mathematics and logic? If so, how is making computer languages resemble human languages a more direct way to improve comprehension than learning some math? Walking up a mountain path is difficult, but not nearly so difficult as moving the mountain until it lies beneath one's feet.

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#58
post #44

Earlier quoted context omitted.

DECLARE FUNCTION q_rsqrt (float number) THAT RETURNS float AS ( .... ); And no programmer will want to write in such a language because it's so verbose. I don't mind making programming languages look more like natural languages; I would offer Python as an example of a language that takes advantage of this where it makes sense. But I draw the line at having to type boilerplate; if it's absolutely necessary, at least k…

It's not that far from PL/SQL and PL/PGSQL CREATE OR REPLACE FUNCTION foo (int bar0) RETURNS int language plpgsql security definer volatile as $$ begin return $1 + 1; end; $$;

Which is the reason I can't stand SQL

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#59

I actually disagree to some extent with Raganwald here. I am both a software engineer and an amateur linguist. Let me try to go into where my disagreement is. I figure that someone, probably me, will have to set the record straight about how poorly our expectations of English grammar match the realities and utilities of this language.[1] Natural languages and computer languages are very different both in how they are…

Thanks for the interesting thoughts.

Re: The English-Likeness Monster Stalks a New Generation of Programmers

#60
post #44

Earlier quoted context omitted.

DECLARE FUNCTION q_rsqrt (float number) THAT RETURNS float AS ( .... ); And no programmer will want to write in such a language because it's so verbose. I don't mind making programming languages look more like natural languages; I would offer Python as an example of a language that takes advantage of this where it makes sense. But I draw the line at having to type boilerplate; if it's absolutely necessary, at least k…

It's not that far from PL/SQL and PL/PGSQL CREATE OR REPLACE FUNCTION foo (int bar0) RETURNS int language plpgsql security definer volatile as $$ begin return $1 + 1; end; $$;

I was thinking COBOL.

Edit: added sample.

http://www.csis.ul.ie/cobol/examples/Conditn/IterIf.cbl

Post reply on HN