Live data from Hacker News

The English-Likeness Monster Stalks a New Generation of Programmers

raganwald.posterous.com

31–40 of 78 posts

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

#31
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 used and in the constraints that exist on them. It is very obvious that you can't write programs in written English for that reason, and the only reason why we have this confusion is not what we expect from programming languages but what we expect from natural languages.

As every introductory linguistics textbook will remind you, natural languages are defined by usage patterns. Computer languages however are defined by parser behavior. They must be rigorously specified, while such specification kills natural languages.

Many people, particularly public school English teachers, would like to see English specified to this level of clean, precise, prescriptive rules, but this doesn't really work in practice. Different dialects occur and these dialects often have very different features (note the habitual tenses in African American Vernacular English, for example, which also occurs in some dialects from England). Usage defines the language, just like it can define good/bad coding practices in one school of thought or another, but usage does not define C. If I decide there is a clearer way to handle pointers, what I come up with isn't C any more. However habitual tenses ("I be workin' Tuesdays") as much as they may be seen as "bad English" by some prescriptivists, are just natural, organic developments within the language.

There are also dialects of English that are less imprecise. For example consider legalese which is often considered to be a hyper-defined dialect of English (also a very formulaic one). The advantage is that legalese can fall back to other English terms for additional meaning and one can be reasonably sure what a contract means even if you are not a lawyer.

So what does this mean about English-Likeness? Certainly we wouldn't expect the laws of the nation and contracts to be written in a purely symbolic language even though these need a level of definition well beyond what ordinary everyday English can provide. In fact if we did so, this would interfere with the function of legal instruments. Legalese may be a hyper-defined dialect but at the end of the day, it is still just as much English as African American Vernacular English is. English likeness is more a blessing than a curse in the field of law, even though it is quite clearly both.

Because English-Likeness is both a blessing and a curse there, it is worth asking the same here. Can an ordinary individual read a program written in Perl or Python and understand it? No, but that same ordinary individual probably cannot read the Supreme Court's opinion in Pedilla v. Hanft, or Hamdi v. Rumsfeld either and really understand what the court is arguing about.

But what English-likeness does is it speeds up learning. There is a difference between how quickly you can pick up Spanish as an English speaker and how quickly you can pick up Bahasa Indonesia or Algonquin. Spanish in both structure and vocabulary is much closer to English than either one is to Indonesian or Algonquin, so I think the same applies, and languages which follow very different structures (lisp reminds me of Irish Gaelic due to the latter's VSO word order) tend not to gain much traction.

Additionally English is probably the best language in the world to be like for a programming language. We have a relatively simple lexical structure and a fairly inflexible word order and much of this is due to the fact that Middle English arose as a sort of creole (with all the grammatical simplification that goes with that) between Anglo-Saxon and Old Norman French. Other creoles might be good choices too, but this is a good choice and we might as well stick with it.

[1] Note, we would never say "Me will have to" and yet within the parenthetical, the normal rules of pronoun cases get shifted a bit. See Bailey, Charles, "How English Grammars have Miscued" in Polome, Edgar (ed) "Language Change and Typological Variation," JIES monograph 30.

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

#32
post #15
post #8

I think PowerShell suffers from this issue, except it was defined by people that speak English as a second language.

You're going to have to explain what on Earth you mean. PowerShell just reads (and writes) like someone forced Perl and .NET to have a child. AppleScript, Inform 7, Smalltalk-72, and other "English" languages dream of being in the same boat as PowerShell in terms of consistency, readability, or power.

I believe that Zikes is merely making a racist comment about the make-up of teams at Microsoft.

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

#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  = number;
          i  = * ( long * ) &y;
          i  = 0x5f3759df - ( i >> 1 );
          y  = * ( float * ) &i;
          y  = y * ( threehalfs - ( x2 * y * y ) );
          return y;
  }
You have written many words and have buried your counterpoint in the process. Put aside the superficial points (e.g. reasons to choose a dialect of English over a dialect of another language) and address the main issue: if programming is the act of translating human concepts into precisely defined math and logic, how can we reasonably rely on such a fundamentally imprecise tool as natural language to get the job done? I contend that there is no sufficiently high level of abstraction where natural language would be more suitable.

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

#34
I'm totally in agreement as far as the current state of NLP and AI goes, but all bets may be off as these fields mature. For example, I have a client that gives me a very detailed specification for a simple iPhone app in a few English paragraphs, along with storyboards, wireframes, and similar apps. I bang out an alpha in a week or two that's mostly faithful to her conception. She writes up some minor changes she'd like, I implement them, get back to her, and on we go until the app is close enough to what she had in mind.

In this case, I'm essentially a really slow compiler turning English language into machine language. Who can say to what extent machines will be able to perform this function in the future?

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

#35

Programming languages all posses one thing that most (perhaps all) natural languages lack: a 1:1 equivalence with some mathematical construct, or an abstraction backed-up by such a construct. In order for a natural language to be useful for programming computers the language must be completely describable in mathematical terms.

Completely agree; left a similar comment upthread. Natural language will be insufficient for programming until we succeed in accurately reducing all natural language to mathematical expressions, which could be achievable if we unlock the secrets of exactly how the human brain stores and accesses data. Needless to say, I'm not holding my breath.

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

#36
post #34

I'm totally in agreement as far as the current state of NLP and AI goes, but all bets may be off as these fields mature. For example, I have a client that gives me a very detailed specification for a simple iPhone app in a few English paragraphs, along with storyboards, wireframes, and similar apps. I bang out an alpha in a week or two that's mostly faithful to her conception. She writes up some minor changes she'd l…

I think you're dramatically underestimating the amount of work your brain did in that process.

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

#37
post #18

Earlier quoted context omitted.

People often think of DSLs as a way of making a concise, expressive view of the domain look like English. See, for example, RSpec. (I guess what I'm really saying is that you're right, but you're saying something else, raganwald is right too.)

I'm having a variant of the Baader-Meinhof phenomenon where I start seeing something everywhere after writing about it ( http://news.ycombinator.com/item?id=5056667 ).

thank you! I knew there had to be a name for this...

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

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

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 think of the natural language phenomenon of ellipsis, this gets shortened essentially to

function sqrt(float number) returns float (

and we might want to change this to make it more concise

float function sqrt(float number) { }

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

#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 at this in his classic "ACLs are Dead" talk, where he talks about using metaprogramming to make Ruby syntax more readable for lawyers.

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

#40

Mathematicians have been developing more abstract and concise symbols for hundreds of years and it looks nothing like English or any other natural language. If I had to guess I would say that future programming languages will look more like mathematics than anything else.

Why wait for the future, you can program in APL or (I recommend this one) J today! Have a look at quicksort in J: quicksort=: (($:@( #[)) ({~ ?@#)) ^: (1 Cute, isn't it? I was playing with J for some time - a few weekends maybe - I managed to get to the level of conscious incompetency, which is a lot for such a foreign language and then stopped, I just had enough. J is certainly very powerful, consistent and logical…

You just don't like using English punctuation as function names.
Post reply on HN