Slashdot Mirror


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?

19 of 709 comments (clear)

  1. APL, LISP, The Matrix and the need for AI by jabber · · Score: 4

    Programming languages were developed by English speakers, and reflect concepts represented in English.

    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. :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?

    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.
  2. Re:Winston Churchill on Japanese "Ambiguity" by sethg · · Score: 4
    Every language has some things that you communicate through the grammar, some things that you communicate through word choice, and some things that are usually picked up through context. (American Sign Language, for example, has a large number of verb inflections -- conveyed by modulating the motion of the hands -- that English only expresses through adverbs.)

    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
  3. Re:Japanese Perl: syntax example by Amoeba+Protozoa · · Score: 4


    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

  4. Nice timing by FascDot+Killed+My+Pr · · Score: 4

    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)
  5. Obvious answer by rotor · · Score: 4

    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
    1. Re:Obvious answer by TheCarp · · Score: 4

      I have to agree here.

      Programming languages only use the same "nouns" as natural languages, and some of the same verbs. In English, we share nouns and verbs with other languages, but that doesn't make the languages equivalent.

      Programming is based highly on math and logic. In fact, thats all it really is. It is a differnt language not based on natural language. As such...a MUCH more interesting topic....

      what is the effect of programming languages on thought? Using a language and becoming fluent in it, requires the brain to think in a different way. It has been said that language shapes thought.

      There is talk of "Geeks" and "normal people". Perhaps this is a construct not of us being different and learning about programming and administration etc, but that we learn it, and it has changed us. We have a plethora of similar languages of our own, even when not programming we talk with a vocabulary and litterary tradition that, to many people, sounds liek a whole other language, or culture.

      I worry about this of late. Look around at how common this is. Turn the focus to law for a min. Do laws get written in normal english? No...they get written in a kind of sub language, by people of another culture, a legal culture. Perhaps their thinking has been shaped by their language, and their patterns of operation? Could that be the link to the reason that those in power and the common man don't seem to understand eachother? Different cultures, different languages (similar but different in usage and somewhat in definitions).

      The more I look, the larger the implications get, and the more true it apears. Perhaps it is a good model...then again...perhaps its that damned law of fives all over again.

      --
      "I opened my eyes, and everything went dark again"
  6. Winston Churchill on Japanese "Ambiguity" by rjamestaylor · · Score: 4
    As to English's effect on programming versus Perl in native Japanese, Winston Churchill might have a (biased) opinion, if he were alive today.

    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
    1. Re:Winston Churchill on Japanese "Ambiguity" by vlax · · Score: 5

      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.

    2. Re:Winston Churchill on Japanese "Ambiguity" by mav[LAG] · · Score: 5
      I noticed in Europe that some language are very difficult to understand when they're shouted. English, and German are easier to hear over distances and through noise because of their hard consonants.

      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.
    3. Re:Winston Churchill on Japanese "Ambiguity" by Sodakar · · Score: 5

      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...

  7. Smalltalk and Ojibwe by RevAaron · · Score: 4

    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
  8. Re:Japanese Perl? by NaughtyEddie · · Score: 4

    Didn't the Japanese bomb Perl Harbor?

    --

    --
    It's a .88 magnum -- it goes through schools.
    -- Danny Vermin
  9. Wouldn't-be-too-different-if-it-was-German by Dr.+Kinbote · · Score: 4

    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).

  10. Lingua::Romana::Perligata by Q*bert · · Score: 5
    Damian Conway wrote a Perl module that lets you write your Perl scripts in Latin, sans punctuation. The basic idea is that Latin uses word endings and not word order to indicate syntactic properties like number and case of nouns and number and person of verbs. Hence you can write position-independent code in Latin. Lingua::Romana::Perligata is basically a proof of concept and an exploration of how computer languages might be different if they had been made by speakers of inflected natural languages. It's also a pretty impressive use of source filters.

    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

  11. Formal Perl by K-Man · · Score: 5

    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
  12. Japanese Perl by SEWilco · · Score: 5
    Maybe Perl in Japanese would let you create its own characters out of existing ones, then use the new characters in the programs. And you think Perl is compact and hard to read now.

    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.

  13. Re:It won't matter by sydney094 · · Score: 5

    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
  14. Sanskrit for computers by anoopiyer · · Score: 5
    Have you heard of Sanskrit? Sanskrit is the language of ancient India, the language of the Vedic culture. Current interest in Sanskrit is mostly academic, there are not many Sanskrit-speaking people left in India. I learng Sanskrit for five years in high school and I believe that computer programming languages can learn a lot from it.

    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

  15. Re:Non-English programming languages? by olofh · · Score: 5

    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