Have you ever thought about a language behind popular programming languages? Many of us take for granted the fact that programming languages like Python, C, Ruby, Lua and many others use English. But imagine for a second that English was not your primary language nor the language you know. Or to put it better, imagine that most programming languages were based on Chinese… Russian or Arabic?
Being a trilingual, I always wondered what it is like to program in languages other than English. Here is a simple Python code ported to Russian and Italian.
The original version:
for item in someList: if item == 'dog': print 'I like dogs' else: print item
The same code in Russian:
для объект в лист: если объект == 'собака': вывод 'я люблю собак' иначе: вывод объект
The same code in Italian:
per oggetto in lista: se oggetto == 'cane': stampare 'amo i cani!' altrimenti: stampare oggetto
This is how it could look if Python was in Russian and Italian. When I tried to wrap Python into these languages I faced several complications.
Most languages aren’t suitable for programming.
One of the advantages of English in programming is that it is concise. For example, English has extremely minimalistic word inflexion compared to Russian and Italian, where words should be modified according to a paired verb, grammatical gender, grammatical number, person’s gender, age and context. Thus, the use of these languages for programming introduces many complications in a formulation of a computing problem and human readability. By the way, Python originates from Netherlands, Ruby is from Japan and Lua is from sunny Brazil.
In English, the Pythonic statement
for item in someList
reads and comprehends quite naturally. If we want to make it Pythonicly readable and grammatically accurate in Italian and Russian, we need each word to have specific declension. Otherwise, the direct translation feels strange.
What does Arnold Schwarzenegger have to do with programming?
My curiosity of trying Python semantics with different languages lead me to discover that there were people who have already created their own flavors of programming using not only different languages but quotes of famous actors like Arnold Schwarzenegger. ArnoldC is a programming language based on Java that uses Arnold’s famous one-liners from his movies as programming statements. The command that entertained me most was TALK TO THE HAND which is the equivalent of a print statement in Python. Here is a short code example of a simple program which begins the session, prints out ‘hello world’ and ends the session.
IT'S SHOWTIME TALK TO THE HAND "hello world" YOU HAVE BEEN TERMINATED