Neat. I also wrote a bunch of Arabic Lisps, most toys that went nowhere :-)
My biggest obstacle has so far been language itself: I think I'm too much of an Arabic snob to settle for simple, dictionary translation of some technical terms. I also hate transliterating, so I got distracted by months long process of compiling a dictionary.
To give you an example, Qlb replies with "letter is unexpected" when it really means "symbol". حرف vs رمز. A Lisp evaluator operates on expressions, of which symbols are a subset.
Even within technical English, words like letter and character do NOT mean the same thing, though they are similar.
Most of computational concepts one wants to expound either exist or have strong counterparts in the classical Arabic linguistic, rhetoric and logical traditions. Though not a strict requirement, the Arabic PL designer would benefit greatly from familiarity with the Classical, very abstract and deductive, byt often non-secular, works.
One of my favorite games is to read a passage out, say, a type-theoretic paper and try to translate it to Arabic :-)
[Edit:
It is an excellent hack this, but Arabic side of things could use more polishing. قول is not a verb, but قُل is. قول or مقولة means "utterance", not the very "say" as you might intend. لقوله، قم الليل الا قليلا
I'm reminded of Damian Conway's module to allow people to program in Latin. One Latin expert that he knew had trouble learning because she kept trying to "correct" the grammar. (He'd found a combination of tenses and genders that was never ambiguous - which was a great help to his parser - but was in many cases not what would really be used in Latin.)
Except that this problem exists in English-based programming languages as well. Attempting to make grammatically correct code that mimics a human language is a futile effort. The next Twitter doesn't care about "is", "was" and "are" in the code.
Yeah futile like applescript - who ever used that.
Or hypertalk, or wolfram alpha or even the google search engine - nobody can figure out how to use those. Visual basic was so unpopular because it tried to use more english keywords and less symbols. The best way for people to learn programming is with pure non-alphanumeric symbols, just like people speak on Twitter.
Well, maybe he meant that very few people are actually really good at formal arabic? I know I suck at it even though I'm Lebanese and it's supposed to be my mother tongue. Arabic speakers tend to have a colloquial form of Arabic that they speak which is a much simplified version of the formal Arabic language.
I would say the closest analogy is Lebanese is to Arabic what French is to Latin. Clearly derived from it, but very different and much simpler.
300 experts is definitely a very low estimate though. Should definitely be higher.
Thanks for your feedback! I agree that language itself is the real challenge. I had to deal with a lot of RTL/encoding issues, sure, but the real difficulty is how do you map engrained concepts from one culture to the next? I don't have any solid answers, and قلب is very much an experiment.
The REPL complains about 'letter unexpected' because the first thing it encounters is the ASCII 'Q', which is invalid outside of a string, and barfs.
I completely agree that Arabic linguistics aren't being utilized to their fullest. My Arabic is certainly not as strong as my English, unfortunately. This is a very preliminary release, and I'm excited to collaborate with others stronger in written Arabic for better word choice and semantics.
I think a lot of people trying to do anything software in arabic get bogged down and indefinitely bike shed over translating technical terms. I think it's just a choice to be made to move along. In your example حرف is just fine.
This sounds awesome. I've contemplated programming in Arabic. I figured that if Arabic as a language is much more expressive and concise than English in normal modes of communication then the advantages would cross over into programming languages. However, as you said, direct syntax translation is ineffective. Perhaps, programming semantics need to change to match the effectiveness of the language or perhaps, and I hate use this term, a new paradigm is needed.
This is actually a myth. Arabic is not more or less "expressive" than any other language. It's just language communities evolve richer vocabularies for their subjects of interest/specialization. Arabic saw feverish interest in philosophy and abstract thought around the time of the Islamic Caliphates spanning almost a thousand years. But other languages evolved similar, even richer philosophical traditions -- I think the growth of English is unparalleled in human history!
This probably doesn't have a bassis in any established linguistic theory, it's just my own "hunch", but I think this community specialziation (DSL-ization?) of languages is real enough (see the persistent myth that Inuits have tens of words for snow. We expect them to, because snow is their "thing".)
We don't need to "adapt" programming languages theory to Arabic, as the foundations are meta-linguistic and presentable in any human language. What we need is a native Arabic programming languages community that puts already codified technical terms into currency.
> I figured that if Arabic as a language is much more expressive and concise than English in normal modes of communication then the advantages would cross over into programming languages.
I always thought a community based, crowd-sourced effort to translate technical terms is a good idea. I will be happy to team up on this if anybody is interested.
> The word "Algorithm", or "Algorism" in some other writing versions, comes from the name al-Khwārizmī, pronounced in classical Arabic as Al-Khwarithmi. Al-Khwārizmī (Persian: الخوارزمي, c. 780-850) was a Persian mathematician, astronomer, geographer and a scholar in the House of Wisdom in Baghdad, whose name means "the native of Khwarezm", a city that was part of the Greater Iran during his era and now is in modern day Uzbekistan. He wrote a treatise in the Arabic language during the 9th century, which was translated into Latin in the 12th century under the title Algoritmi de numero Indorum. This title means "Algoritmi on the numbers of the Indians", where "Algoritmi" was the translator's Latinization of Al-Khwarizmi's name.
Khwarizmi was a great guy. But it will be nice to cite his influences as well - like he introduced Indian Numerals (Which the world wrongly calls Arabic Numerals).His work in Algebra is based on previous work from Indian and Greek sources. Surely that doesn't make him father of Algebra. However, his other controbutions are stupendous and one of the first treatise in Math worth recollecting. Persian history has indeed contributed many great things to the world (And please don't use it interchangeably with Arab or Arabic).
Actually, al-cohol roughly means "the blue", referring to the blue tint of many alcohol-based make-ups used in the Near East in ancient and medieval times.
While on the subject of words with Arabic etymological roots, my personal favourite is Betelgeuse. The Arabic name of the star is يد الجوزاء (yad al-Jauzā) which means "the hand of the Jauzā". But after a few medieval translation it got morphed into it's current name. Which, unfortunately, ended up sounding like, and often back translated as, ابط الجوزاء -- literally "the armpit of the Jauzā"!
Great! Next step, programming in the Diwali style of Arabic script[1]. This is one of the amazing forms of Arabic calligraphy that often graces classical Arabic architecture and other works of art. Because really, don't we all want software that looks like this[2]? ;-)
Unfortunately, I understand that Diwali takes sufficient liberties with the forms of written Arabic that it's often very hard to comprehend even for those highly literate in Arabic.
This acts simply as a direct translation of what looks like some sort of lisp into Arabic symbols. I once did something similar with #define in C. The calligraphy bit is a side effect of using Arabic letters, which tend to be intrinsically good for calligraphy.
No, I write the code normally, then I manually lay out the tile calligraphy and build the mosaics by hand. There's no way to automate the process that I know of. It's tricky to get everything to fit together and look right. I am a novice at this stuff, and master calligrapher Mamoun Sakkal's website has been a great help http://www.sakkal.com/instrctn/sq_kufi_alphabet.html.
The writeup could be more clear about how the mosaics are made, though. I'll update it.
Just realized the title was misleading so I removed the word "render."
I don't think the calligraphy is rendered automatically at the moment. Looks like the author is doing it manually. I'm guessing automatic rendering is planned, but not sure of that.
I'm not so interested in automatic generation of calligraphy for this project, to be honest. I find something meditative about spending a lot of time sweating over laying out these algorithms. It mirrors the struggle I had (we all had, I imagine) while trying to understand them in the first place.
Hmm, I see. Do you know if the calligraphy itself could be executed/interpreted? The idea of a visual representation of a program being art but also executable appeals to me.
A friend of the author of QLB here, and I brought up the idea of a visual interpreter to parse the square kufic calligraphy. My understanding (limited as it is by my almost complete ignorance of Arabic) is that certain stackings of adjacent words would be ambiguous to the parser.
Probably about as easy to learn as brainfuck for Western progammers. Interestingly shows the extra hurdle to be overcome for programmers who do not natively use the romanic alphabet, with the more mainstream languages.
My native language is Farsi which it's alphabet is very similar to Arabic. First problem is when we work on projects that need to output RTL text. We have to program LTR with RTL string. No editor or IDE can handle it. Specially command line tools. When a string contains both LTR and RTL text then it will be a headache to maintain. You never know where is the ending quotation sign.
The other fun fact is, for us non English speakers who started programming from early years of our life, some English words doesn't mean what they actually mean. For example I didn't know what `inheritance` means in real life but I was writing hierarchy in programs for a while!
I'm a native English speaker, yet there were several words I knew the computer meaning of before I knew the normal meaning. For example: icon and palette. When people used the word "icon", but didn't mean the thing you click on to start a program, I was confused.
I think with a large and less subtle font (perhaps the sort that would be used in an Arabic child's book?) I could learn to read code written like this without necessarily having knowledge of Arabic beyond some fundamentals and the vocab needed for the few keywords. The best bet in the long run, if my career depended on it, would undoubtedly be to buckle down and learn Arabic though, and being mono-lingual that seems like an absolutely insurmountable task.
Input would be a whole other story, I wouldn't even know where to start.
Input's not that hard. I typed this out from a few days' study and a bit of playing around a few years (10 or so?) back: http://pratyeka.org/arabic/
(I was somewhat disgusted to see vast quantities of US military domain based visitors as the wars scaled up)
Arabic is kind of like the Roman family of scripts or the Abugidas of India/Southeast Asia in that there are actually many related scripts with mostly common symbols and a common heritage.
Case in point: (Chagatai) Uighur. http://www.omniglot.com/writing/uyghur.htm ... or Farsi ... ie. definitely worth investing some time in to this script family, or teaching children a little about, certainly if you travel, or study history or art at all.
For that reason I think it would be very cool if there were a thorough tutorial for this language aimed at English speakers. We could begin to understand the difficulty that speakers of non-Latin languages face learning English-based programming languages.
You need to put a 0x200F (Unicode's right-to-left-mark) both before and after the text, so the neutrally-directed characters ( ) and " will inherit the directionality of the Arabic text, instead of the top-level left-to-right context.
If you are interested in Arabic programming languages then this will be a treat ;)
Kalimat كلمات –meaning Words translated from Arabic– was designed and built as a programming language that teaches children programming in Arabic as a part of facilitating the process of bringing Computational Thinking to schools in Egypt and allowing children to practice what the've learnt using a powerful programming language.
With children on the mind of the language designer, he made sure that every feature to be added won't add complexity to learning the language but rather empower children to explore more about programming languages.
Kalimat is written in C++ using the QT Framework, and it runs on a virtual machine written by the author of this programming language called SmallVM (proving names can be deceiving :D). Both Kalimat and SmallVM are open source, you can checkout the code repository here: https://code.google.com/p/kalimat/source/checkout
Although Kalimat is written for children, that doesn't mean that it is weak or to be considered as a toy language, it's quite the contrary actually. Under this seemingly cuddly language, there's a small beast growing as the author packs the language with features that appear in professional languages.
I am not the author of the language, so I am not familiar with all features of this language, for more details you can:
It is a sad thing it doesn't get enough publicity despite the effort put to it I guess. As far as I know, it got covered in a few Arabic forums and magazines, but didn't get any global awareness.
I myself learnt about كلمات because the guy behind it was a TA in our university. He's a real inspiration and some of his ideas are really innovational.
Judging by your name, I think you are an Arabic speaker, if so you could check his blog to see for yourself http://iamsamy.blogspot.com/.
About a year ago he started another blog titled Computational Thinking in Egypt if you're interested: http://ctegypt.blogspot.com/.
Not to be confused with It's phonetically similiar 'kalb' which means dog. The different pressure points that the q/k sound arise from can be difficult for non arabs to seperate sometimes.
Just in case you want to tell your partner "my dog is bursting with love for you"!
This makes me really appreciate non-english speaking programmers. They not only have to learn all the logic and syntax I do, they had to learn the symbols and what they meant and the english words.
this is amazing, I created a similar hack for the "deseret" language. There is a running repl at http://deseretpl.org
It has multiple levels of authentication - highest is:
user: elohim
pass: melk
It is essentially a port of a toy lisp (soy) I wrote a while back so deseret keys map straight to their ascii equivalent (as that is what deseret itself really did).
QLB is much cooler in that it seems to be make semantic sense.
I was a little confused by the link; the main image is a screenshot of what looks like a fairly ordinary Arabic text editor. I think the calligraphy referenced here is the tile mosaic in the photograph. There's more photos of geometric / artistic typesetting of QLB code in Nasser's tweets and blog. Is this Kufic-like calligraphy being autogenerated from the source code? Or is it laid out by hand?
Some years ago I asked: what would "programming" look like if it was not "invented"/"dominated" by the western culture?
It's not only about the symbols ... how about f.e. a more holistic approach to problem solving instead the dominating "commanding" approach used to "control" a machine ...
This is because github does not yet support right-to-left (RTL) programming languages ;-)
To display the text RTL, you need to specify the direction attribute ("dir") in HTML.
interesting experiment! but I think we should benefit from other cultures experiments also; I mean, is there any similar (Chinese,Japanese, ...etc) programming language? and what are the benefits or experience they got from these languages?
My biggest obstacle has so far been language itself: I think I'm too much of an Arabic snob to settle for simple, dictionary translation of some technical terms. I also hate transliterating, so I got distracted by months long process of compiling a dictionary.
To give you an example, Qlb replies with "letter is unexpected" when it really means "symbol". حرف vs رمز. A Lisp evaluator operates on expressions, of which symbols are a subset.
Even within technical English, words like letter and character do NOT mean the same thing, though they are similar.
Most of computational concepts one wants to expound either exist or have strong counterparts in the classical Arabic linguistic, rhetoric and logical traditions. Though not a strict requirement, the Arabic PL designer would benefit greatly from familiarity with the Classical, very abstract and deductive, byt often non-secular, works.
One of my favorite games is to read a passage out, say, a type-theoretic paper and try to translate it to Arabic :-)
[Edit:
It is an excellent hack this, but Arabic side of things could use more polishing. قول is not a verb, but قُل is. قول or مقولة means "utterance", not the very "say" as you might intend. لقوله، قم الليل الا قليلا
]