English Language And Its Effect On Programming?
jasno asks: "I've been wondering lately about the effects that the English language has had on programming languages. Have the limitations/ambiguities/peculiarities of the English language changed how we might have created, for instance, C if we spoke, perhaps, Swahili? Since English is my only language I'm curious to see what my multilingual companions have to say about this." Interesting thought. What would Perl be like if it was coded by a native Japanese speaker?
Churchill wasn't a linguist either, and I seriously doubt he spoke a word of Japanese. His French was mediocre, and so was his German. As an educated man of his class, no doubt he had some training in other languages, but it's doubtful any came from outside of Europe.
I, however, am a linguist, although I am not fluent in Japanese, and I find the argument extremely doubtful. I've never heard of any effective way of measuring ambiguity in a whole language. Language as a tool of communication generally adapts to serve the users' needs. If it needs precision, precise codes are adopted by the speakers. If the Japanese navy had problems communicating clear orders, I'd look to their training and communications practices, not the language itself.
If the Japanese language was too ambiguous to give clear orders, how on earth could Japan in the space of 40 years develop a very productive, highly advanced industrial system?
Take great care in evaluating arguments that claim one language's superiority over another on some internal basis. I've heard a lot of them and I've never seen one that could stand up to any scientific test.
Damian gave a talk on the module at the O'Reilly Perl Conference, but unfortunately neither the talk nor the module is available on-line. He said he was going to post the module to CPAN, too... Maybe it's time to bug him about that.
Anyway, a person who attended the conference faxed me his paper for the speech; if you're interested, e-mail me (after de-spam-proofing my address), and I will fax it to you.
Vovida, OS VoIP
Beer recipe: free! #Source
Cold pints: $2 #Product
If perl were written like Japanese, it would have different forms depending on the computer's relationship to the coder. If the computer were older or higher in social status than the coder, the coder would have to use elaborate formal endings on all suggestions (commands would be forbidden). If the computer were younger or lower in social status, the coder would be able to use short, direct commands, and would not have to address the computer by title, or bow after each statement.
Men and women would also have different vocabularies. It would be considered improper for a male to use "Ladies' Perl" in most computer environments (except perhaps the Mac).
---- "If we have to go on with these damned quantum jumps, then I'm sorry that I ever got involved" - Erwin Schrodinger
Of course, the opposite would happen with German Perl. You'd create new words by concatenating existing ones, so you'd have a word 4,000 characters long which would do everything related to a specific task -- change one of the component phrases and the new word does something related yet different.
It definitely helps to shout if you're an English speaker. Whenever I've been in Europe and the locals haven't understood me, I've just shouted louder...
--- Hot Shot City is particularly good.
Moreover, I'd say that the only difference would be the names of the keywords.
Languages like Japanese (for example) have a completely different grammatical syntax than English. But then again, so does programming... The difference between coding in one langauge or another is mainly syntax and vocabulary, just like with the differences in spoken languages.
However, all programming languages are meant to make it easier for the programmer to communicate with the machine. Since it all gets converted into machine language anyway, most programming languages have a syntax that is more mathematical. So, even if our founding coders spoke a completely different language, the syntax would probably have been based on mathematics.
This leaves only the vocabulary to be a little different... meaning that we would probably only have different keywords.
"If we knew what we were doing, it wouldn't be called research." - Einstein
The grammar of Sanskrit is very tough to learn since it is very vast and there are a lot of things to remember than in a language like English (somewhat like C++ being more complicated than C). But it's all very very logical and straightforward. The main thing is that there are a lot of forms of the same word. For example, udyanam means garden; udyanasya means "of the garden", udyanat means "from the garden" , and so on. There are several forms of the same noun. Each form has a unique meaning, and each meaning has a unique form. There is absolutely no ambiguity. Same for verbs and adjectives and other language constructs.
One beauty of this uniqueness is the fact that now the order of the words in the sentence doesn't matter at all. For example, consider that you want to say "I am going to the garden." Aham is I, udyanam is garden, gacchami is going. So I would say, Aham udyanam gacchami. Now I could also say that udyanam gacchami aham or gacchami aham udyanam or any permutation, all of which mean exactly the same thing. Taking this one step further, I could simply say udyanam gacchami since the verb gacchami implies the "I". If it was somebody else who was going to the garden, I would have to say gacchati, and if it were you, I would have to say gacchasi so the verb form implicity determines the subject.
This is just a novice example of the fact that a lot of semantic information is built into the syntax of Sanskrit in a very elegant way that would appeal to purists and compiler designers. I believe that natural language parsing of English and other European languages is much tougher than parsing Sanskrit would be. The downside to adopting Sanskrit would be the vast number of grammar rules and verb and noun forms that have to be learnt.
Professors in the few universities in India where Sanskrit is still being taught strongly advocate the use of Sanskrit for computing. I just know high-school level novice Sanskrit, so if there are Sanskrit gurus among you, speak out with more relevant details.
Anoop Iyer
Umm... Native Japanese speaker here... Thanks for the interesting post, and I'll be sure to check out that book sometime...
In the meantime, I'd like to quickly post that when it comes to military commands, the Japense military, much like any military, had short, descriptive commands that were to the point. If anything, I would think that the tactical limitations came from the inability of individual soldiers to act on their own accord, because of the absolute authority of their C.O. Tactical changes would have to go through many levels before it was approved.
Having said that, I will admit the Japanese are very good at being ambiguous if they want to be, and the language definitely supports that. Being blunt was seen as something the "common" man would do back in the day of the royalty, and hence the attempt to speak in poems, etc, etc... And... no offense, but poetry, as much as I enjoy it, can be about as ambiguous as it gets.
In order not to receive an OT-mark, I will say that the Japanese, in general, code very well, and I haev no problems reading it. I wonder if they're just that "type" of person, or if the Engligh language helps them be blunt/clear/etc...
Apple Computer released the original version of AppleScript in 1992 with 3 dialects: English, Japanese and French. Not only did they all have native keywords, but the AppleScript engine was able to do automatic translation between them. And it worked, too -- word order, proper syntactical constructions, plurals, masculine/feminine, etc. etc.
This made for a really, really cool demo, especially for Japanese people who read little English. I did this a number of times for people and their eyes lit up rreally wide, and I could tell they were thinking "so that's what all that gobbledygook programming stuff means... "
Non-English dialects were killed from AppleScript two years ago, likely because it was too much effort to support. But it was way cool.
- Olof