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?
Programming languages were developed by English speakers, and reflect concepts represented in English.
:P) The idea of regular expressions is a good example. It's mathematical, not 'natural' (not to be confused with "Natural" in the Kleene-star sense). We all understand regexp, but how much 'natural' language did this understanding cost?
If we were able to divorce ourselves from our language, and design a language centered on computational concepts, rather than linguistic ones, then that language would likely look a lot like APL, or LISP, or those funky squiggles we saw in The Matrix.
It's a hard thing for people to do, separating ourselves from language. Even those of us who speak more than one language fluently, tend to THINK IN A LANGUAGE. Yes, we all perceive concepts abstractly, but we formalise and represent them, inside our own heads, using a language. Communicating is something we do naturally, and we communicate with sounds and printable characters. It's just a part of our biological wiring.
One interesting line from The Matrix sticks out when we think about this: The first 'Matrix' failed because, "some thought we lacked the language to represent your puny little world".. Or something to that effect. The machines considered creating a new language that would have a greater level of semantic richness to describe the problem.
This is an interesting idea, since human languages, all of them, evolved to describe the 'natural world'. We have no problem with understanding the causality of if-then, do-while or has-a and is-a... Even the concepts of OOP are 'natural'. Encapsulation, inheritance, aggregation, these are all natural concepts derived from the natural world and described with natural language. Any human language should be able to describe the world, and so any can be used for programming. The structure of programming languages would not be very different, because they are developed by beings who think in a language used to describe the natural world. {whew}
Now the neat part: What would a language be like if it were designed from the ground-up to be centered on computational concepts, and not those of the 'natural' world?
It would look like APL, with it's huge number of characters used to describe complex ideas that take many words to explain to people. If-Then is easy to explain to a newbie. How do you explain tail-recursion, or semantic closure? How do you concisely respresent a colored-tree (tertiary or more) without using the metaphor of trees and colors?
A language developed in a natural language other than English would not be all that different that what we're used to. (Not that PERL looks anything like English to begin with.
A language designed around computational concepts would look cryptic and superbly compact. The idea of programming patterns could potentially be represented as a single character, or a small set of glyphs which would require a long verbalization to translate into a human language. Such a language would likely be LISPish in structure, where instructions and data would blend seamlessly into each other.
This language would probably use coding-time translation tables and run-length instruction encoding in source, and would build complex concepts from little ones whenever needed; much like we do with functions, but from a much finer, to a much broader scale. This language would be self-referential, self-describing and self-modifying.
A langauge like this could not be designed by a human, because we are by definition prejudiced towards 'natural' languages. A computationaly centrered language could only be written by a machine which itself would have the capacity for manipulating abstract concepts. A pretty tall order.
A programming language designed by the ancient Celts, the Arabs, the Japanese or Babylonians would certainly APPEAR very different from Java, but after translating it - it would be simple to understand. A language built on un-'natural' concepts might not be comprehensible because it might include concepts we can not conceive of.
Time to re-read "Godel, Escher, Bach" one more time.
-- What you do today will cost you a day of your life.
I can imagine this conversation between two native speakers of Japanese:
"English is a really ambiguous language. It doesn't have words for politeness levels."
"Actually, it does have words like 'sir', 'madam', and 'boy', but for some reason, people don't use them. I guess they just deduce the politeness level from context."
And if this were the 1980s rather than the 2000s, the conversation could go on: "Maybe that's why Japanese manufacturing firms are kicking the Americans' butts -- since the English language doesn't mark politeness distinctions clearly, American workers don't respect their bosses as much as Japanese workers do."
--
send all spam to theotherwhitemeat@ropine.com
I speak a little Japanese from what I took in college, and there are some unique features of the language that might effect syntactical structure.
For instance, the acting verb in a sentence almost always occurs at the end of a sentence. To use English with Japanese grammer, the sentence, "I use Perl," would roughly reconfigure as, "I Perl Use."
This may have the effect on function definition and usage. Perhaps this would be the case:
{
argument++;
} function (&argument) increment;
i = 0;
((i)increment)print;
I think the one other good way to trace or guess as to the syntactic etomology of a programming language would be to look at that nation's written mathimatic syntax, as many computer languages stem from math notations.
-AP
I just finished (re-)reading Steven Pinker's "The Language Instinct" where he 1) explains Chomsky's theories and 2) expands on them with his own theories. (I'm no linguist, so expect this post to be followed by a lot of "you are an idiot", "do some research" or "that's not quite right" posts)
First, people don't think in the language they speak in. When you think about a dog eating ice cream you don't literally think the words "The dog is eating ice cream". There is some "mentalese" that you are actually using. When you decide to speak aloud, you translate this mentalese into your language of choice (English, for me). My understanding of Pinker's explanation of Chomsky is that everybody has the same mentalese.
That said, here is my addenda to Pinker's explanation of Chomsky's theory (with help from Church-Turing) would be: All programming languages are equally powerful and isomorphic. This indicates that there is some abstract "algorithmese" that all programmers (can) think in. Therefore, while it may be the case that C is especially close to English*, but if so it doesn't really matter.
*I doubt this is the case. C is very verb-oriented: printf(the_data). C++ is very noun-oriented: the_data.print.
--
Linux MAPI Server!
http://www.openone.com/software/MailOne/
(Exchange Migration HOWTO coming soon)
We probably would have ended up with much the same constructs, just with different words representing things. Why? Because it's not really based on english - it's based on machine code, logic, and math. English is just what we use to represent these things (if, while, whatever function calls, etc...)
Addlepated - punk & metal
In his The Second World War (a six-volume set mainly of his memos as Prime Minister and Minister of Defense for GB during that war) he attributes the collaspe of the Japanese Navy's offensive strategy in the South Pacific (particularly the setback in the Coral Sea in 1942) to the ambiguties of the Japanese language. In substance he said the Japanese had to withdraw and regroup whenever a tactical plan met with an obstacle because of language ambiguities, while the English-speakers could communicate in clear, definite fashion to make ad-hoc adjustments as needed.
IANALinguist, but I found Churchill's comments fascinating. If some Japanese-speaking /. community-members want to refute this notion, please do. (I'm not proposing it is true, only reporting what the Prime Minister said).
Now hiring experienced client- & server-side developers
-- @rjamestaylor on Ello
One of the original design intentions of Smalltalk was to create a language which resembled english more than other programming languages of the day, but remaining terse and effecient enough. While Smalltalk doesn't look exactly like english, it follows a similar syntax as basic english sentences- noun verb and noun verb noun.
To me, I see Smalltalk as resembling the language of the Ojibwe people, a Native American tribe which lived in parts of Minnesota, Wisconsin, and Canada. While I'm not an expert in Ojibwe (having only one semester worth), I have a basic understanding of the general mechanisms of it. Ojibwe is very modular and simply sytactically, much like Smalltalk, whereas english is simple sometimes, but there are many gotchas even in simple constructs.
Ojibwe has the concepts of a pre-verb, that is, a one syllabal modifier of the verb, to change context. They declare future and past tenses, as the desire-to-perform-the-verb, the probability-the-verb-will-happen and others. It'd be an interesting idea to introduce to a language- small messages to an object to change context it's recieving it. Perhaps something like "(anObject become: somethingElse) doThis". Currently not used often, using them as a fundament of design might develop a new way of solving problems and coding the solution.
Nindigoo ojibwemong Enigoons. Giga-waabamin!
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
Didn't the Japanese bomb Perl Harbor?
--
It's a
-- Danny Vermin
In my opinion, programming languages mirror natural languages only loosely. But there are certainly some things which makes programming
languages similar to natural English:
(1) English is almost inflection-free, which means
(2) that it has to have a strict word ordering
(3) which make programming languages simple to parse
German, however, has case markers and therefore
free word ordering.
So, in principle, you could exploit that feature
in a natural-language-like programming language:
ASSIGN value TO variable
WEISE der Variablen den Wert ZU
WEISE den Wert der Variablen ZU
which would be unambigious in German.
However, the case markers in German are in many cases bound to the articles, and usually, one just would have something like
ASSIGN b TO a
WEISE a b ZU
where the case markers have disappeared, so
even the German version would have to rely on a
(previously agreed upon) word order.
Thus, the strict word ordering of today's English-like language seems pretty inevitable to me.
However, if we leave the realm of Indoeuropean
languages with its "a does b to c" scheme, the
question would certainly be a different one.
Agglutinating languages? Non-ergative languages?
They probably might have developed a totally
different concept of writing down algorithms
(or might even have developed a non-von-Neumannian
machine).
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.
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
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