back to article Meet قلب, the programming language that uses Arabic script

Programmers often talk about writing "beautiful code," but computer scientist Ramsey Nasser has taken that idea to new lengths by developing the first programming language that uses Arabic script for its source code. The language is called قلب – roughly pronounced "alb," after the Arabic word for "heart" – and as Nasser …

COMMENTS

This topic is closed for new posts.
Silver badge
Joke

"Some of us old timers had to learn the hex codes for several different processors."

What worries me as I get older is that hex codes (7E JMP on a 6809)are starting to be the only thing I remember !

3
0
Anonymous Coward

"If you can't remember a dozen words (or symbols)"

Fair enough (and those of us who are real old timers learnt octal, not hex codes...) but it isn't a dozen or so.

If you use a left to right language based on the Roman alphabet you can create understandable function names no problem, but right to left languages do present a bit of a problem. I expect someone will tel me they have a C compiler that accepts mixed Arabic and Roman for C, because some people will do anything, but it is hardly mainstream. The program on which I currently work has thousands of descriptive function names, whereas remembering a couple of hundred opcodes compared to having all those in a foreign language you don't know is easy in comparison

0
0
Gold badge

You don't need a new language for this

If you can't write a pre-processor to convert text from your chosen language into the character set expected by your compiler then you aren't a real programmer.

C++ makes it particularly easy because it allows a huge range of Unicode characters in variable names. (This ought to be true for any serious language, but I imagine there are exceptions.) In fact, *your* pre-processor would only have to translate the half-dozen tokens used by the C++ pre-processor and you could then use a header file with some well-chosen #defines for all the keywords of the actual language. Since this replacement doesn't actually change line-numbers, compiler error messages would still point to the right place and source-level debugging would still work.

Remember to write another translator for the reverse direction, so that you can import other people's code.

Translating the comments is "left as an exercise for the reader". For most code, simply removing them is probably the best bet, even if they were written in your own language.

6
2
Bronze badge

... and we loved it!

0
0

hex codes for several different processors...

so that must have been like programing in a foreign language then......

0
0

Re: You don't need a new language for this

Exactly, if your code needs comments, consider re-writing it.

Anyway, this type of translation could be done along with the code-tidy macros. (sometimes I wonder how people who use visual studio can get their code so badly formatted when it does it for you when you type the closing brace)

0
0
Silver badge
WTF?

Not the revolution you were looking for

This is all so wrong - a street performance artist rather than an artist with any insight into the subject matter.

We've already got more than one computer language per week for 50 years. Now you want to compound that by my Scheiß vs. your merde ? بذاءة!

"As a result, all of the most popular programming languages, libraries, and APIs in use today are built with commands based on English words, such as "function," "for," "if," "loop," and so on. That can make learning programming especially difficult for students whose native language doesn't even use the Latin alphabet, for whom the keywords are little more than abstract symbols."

They're keywords, they represent abstractions. It does not matter what symbols you use as long as they succinctly represent the idea. Does using "如果" really change anything? How about "assuming"?

Oh, look, "إفعل" is "do", "إذا" is "if", "حدد" is "set" (see qlb/qlb.js), "قول" is "say" (qlb/primitives.js), etc. Not a revolution here I think.

The only possible hook this argument might have is that the first education in a new area should be as 'comfortable' as possible for the student. That's why introductory texts are in native languages? However, nothing you can do will make learning programming less difficult for the majority of people.

""If we are going to really push for coding literacy, which I do; if we are going to push to teach code around the world, then we have to be aware of what the cultural biases are and what it means for someone who doesn't share that background to be expected to be able to reason in those languages," Nasser says."

Examples would be helpful, as this looks like drawing pictures with waving flashlights in the dark.

I fail to understand how computer languages are based on human languages to such an extent that this is a worry. The only things essential are consistency and sequentiality. Is this some hangup over SVO vs. SOV or abverb/verb and adjective/noun ordering? Hey, does he know about Forth?

"What makes قلب unique, however, is that it allows Nasser to write programs that are not only functional, but also visually pleasing. By varying the lengths of the lines that connect the Arabic letters that make up the language's commands, Nasser can reshape the appearance of his code without altering its function, producing programs that are both practical and artistic."

ORLY? Okay, maybe not Python, but you can alter the appearance, the layout of code in many languages at will. That is, if you are perverse enough. "That's ART" you fool!" Ah, my mistake, I thought it was supposed to be readable.

Strangely, looks like code to me, just with Arabic symbols. Sorry, I'm unconvinced.

Conway in qlb

Fibonacci in qlb

15
1
Angel

Re: Not the revolution you were looking for

I chuckled at the thought of an alternate version that refuses to compile if it isn't also readable as valid holy scripture... I think this idea has appeared in science fiction before. IIRC, the object was to design a perfect program, that was also a prayer, which would result in either a simulation representing a religious utopia, or the actual alteration of reality itself...

4
0
g e
WTF?

Re: Not the revolution you were looking for

At least 'for', 'loop', 'while', etc don't force most people to learn a new alphabet as well as remember the syntax...

Someone has too much time on their hands, or needs a girlfriend.

2
1
Windows

Re: Not the revolution you were looking for

من منكم تستحق هذه الكلمـــــــــــــــــــاتى:؟!

Now, that's what I call a "line" of code....

(No idea what it means...)

2
0

Re: Not the revolution you were looking for

Google Translate says: You deserve this Alkellmaty:?!

Made me shiver, to be honest.

0
0

Re: Not the revolution you were looking for

Just click the Google translate button if you're using Chrome and most of the code converts to English.

0
0
JDC
FAIL

Re: Not the revolution you were looking for

"At least 'for', 'loop', 'while', etc don't force most people to learn a new alphabet as well as remember the syntax..."

Except of course they do, if you're Russian, Egyptian, Chinese, ...

2
0
Bronze badge

Re: Not the revolution you were looking for

"Google Translate says: You deserve this Alkellmaty:?!

Made me shiver, to be honest."

عدل بذرة (الكون-المقبل) ... [from konway.qlb, line 51]

Justice seed (the universe - next)

>ulp<

0
0

Re: Not the revolution you were looking for

I believe you might be referring to Arthur C. Clarke's "The Nine Billion Names Of God"

1
0

Re: Not the revolution you were looking for...Russian, Egyptian, Chinese, ...

yeah, but thats not like a lot of people or anything!

0
0
Anonymous Coward

Re-invent the wheel

The Japanese make all the best electronics. I wonder is it Japanese writing script that ensures their products are reliable. Maybe they have re-invented Kirchhoff laws or replaced nand gate symbols with Japanese script.

Just a thought?

0
0
Silver badge

Re: Re-invent the wheel

Nah, that ain't the reason:

SONY. Because Caucasians are just too damn tall.

http://www.youtube.com/watch?v=96iJsdGkl44

Seriously though, there is marked difference between the West and Japan in the culture mental arithmetic, and notation may play a small part in that- so there may be a grain of truth in your hypothesis. Manufacturing is a different matter, but post WII it was influenced by an American manufacturing engineer (JIT, philosophy of perpetual improvement), as well as their own traditions.

1
0
Anonymous Coward

Re: Re-invent the wheel

To quote my tutor in manufacturing technology,

"British and American operational researchers wrote books on how to improve manufacturing. They were read in the UK, the US, and Japan. The difference was that the Japanese, not being privy to what went on in Western factories, believed them."

3
0
Anonymous Coward

Re: Re-invent the wheel

"an American manufacturing engineer (JIT, philosophy of perpetual improvement)"

I presume we're talking about W Edwards Deming (RIP)?

For folk who've not benefited from Deming's insights yet, the Wikipedia article is a decent start. But don't expect your corporate-sponsored "continuous improvement" drones to talk about his ideas, even if they've heard of him, because much of what he says is not convenient for traditional Western management.

1
0

New western programming language to stop using Arabic Numerals.

VIII PRINT "WHY?"

IX GOTO VIII

17
0
Anonymous Coward

Re: New western programming language to stop using Arabic Numerals.

Bit of history for you.

The number system was invented in India and was referred to as Hindu Numerals by the Persians. The Europeans then got them from the Persians and called them Arabic Numerals.

The actual European representation of the numerals (0,1,2,3,4,5,6,7,8,9) didn't happen until the late 15th century when they were used in printing presses.

4
0
Trollface

Re: New western programming language to stop using Arabic Numerals.

So what do I pass to exit to show correct termination of my script?

0
0

Re: New western programming language to stop using Arabic Numerals.

RETURN I - I

2
0

Re: New western programming language to stop using Arabic Numerals.

@Wraith

Hmm. that is tricky. "X - X" ?

0
0
Bronze badge
Coat

Re: New western programming language to stop using Arabic Numerals.

No, no, it's just I. Roman numerals are 1-offset - like IVORTRAN LXXVII.

2
0

This post has been deleted by its author

Silver badge
FAIL

Am I missing something?

Whilst rarely seen in computer fonts (especially programs), our Roman letters can be written in "joined up writing", as most people do when writing with a pen.. Nothing stopping you making these 'joins' longer or shorter to fit some style.

Still if you want code to also be artistic, don't forget the source code for that Fujitsu web page that had the html indented to look like the landscape as seen from Tokyo (I think)...

1
0

Re: Am I missing something?

but arabic script (as with handwritten latin script) uses subtly different symbols depending on the location of the character within the word or the preceding/following characters

0
0

قلب surely is pronounced as qalb?

2
0

The gutteral consonant is often dropped in standard Egyption pronunciation, leaving the word itself sounding more like (forgive my transliteration) "aowlb".

1
1
Anonymous Coward

"The gutteral consonant is often dropped in standard [Egyptian Arabic]"

Ok, thanks for that. I had assumed the reported could not read Arabic and made a mistake.

[ I have a passing familiarity with Arabic. I can read it and often make sense of it through extrapolation from another Semitic language. I love the way Modern Standard Arabic sounds though, especially when spoken by an educated speaker. ]

1
1
Happy

I'm going to pronounce it as "squiggle".

12
0
Silver badge

Re: pronounce it as "squiggle".

Remembering Prince's little snit with his record label, how about "The computer scientist formerly known as Knuth"?

2
0
Gold badge
Happy

Re: pronounce it as "squiggle".

The artist formerly known as Prince,

While on stage, used to posture and mince.

Then just for a giggle,

Changed his name to a squiggle.

And nobody's heard of him since.

[stolen from I'm Sorry I Haven't a Clue]

0
0
Silver badge

Kashida

I think that putting the basic commands of a computer language in Arabic - or Thai, or Armenian, or French - is a perfectly legitimate idea. Really, to be neutral, the Latin equivalents of "if", "then", "goto" and so on should be the standard.

However, while an attractive appearance of formatted programs is a good thing, there are high-quality Arabic typefaces that implement a feature called "kashida" properly, with graceful curved extensions to the joins between letters. Presumably, a programming language works with ordinary fonts, to I am a bit concerned that this aesthetic feature will not succeed.

0
0
Anonymous Coward

Re: Kashida

Neutral language? Latin? The vengeful ghosts of the Persians and the Germans will prove you wrong. As for the Chinese and the Russians, they didn't even notice the Roman Empire.

That's what is wrong with Esperanto - it is an "international" language which assumes that everybody either knows Latin or speaks a Romance language.

3
0
Anonymous Coward

"..the most popular programming languages, libraries, and APIs in use today are built with commands based on English words, such as "function," "for," "if," "loop," and so on. That can make learning programming especially difficult for students whose native language doesn't even use the Latin alphabet.."

It's not just Johny Foreigner that's inconvenienced. Anyone who speaks and writes "proper" English has to try and develop the habit of mis-spelling words like "colour" and "centre" when using them in the context of writing code. I mentally read the 'Merkin versions as "coll-OR" and "sen-TER" when coding to try and force my wee brain to differentiate but, even then I do still occassionally stick an accidental "colour" or "centre" in my code, as a result of decades of accumulated muscle memory trying to spell things correctly. .

11
0
Silver badge

I went the other way. I learned to program first on an old DOS machine running quickbasic that I got second-hand, and picked up American spelling from there. My english teacher constantly marked my spelling as incorrect, resulting in a battle of wills that lasted for years: I refused to change my spellings, arguing that spelling is a consensus and the US, with it's much greater population, was now the greater authority on english spelling.

3
3
Facepalm

@Suricou Raven, you owe your english teacher an apology.

You seem to have forgotten about the English (first or second) language speakers of the Commonwealth nations, as well as all of the English speakers in the EU (just guessing but I doubt that too many Europeans use the American spellings), I think you're out numbered.

As for the "art" in this article, I present "Hello World" as art (some help from google translate of course).

# تشمل <iostream>

باستخدام مساحة الأمراض المنقولة جنسيا؛

باطلة الرئيسي ()

{

محكمة << "أهلا بالعالم!" << ENDL؛ محكمة << "أنا فنان أكثر من رائع!" << ENDL؛}

3
0
Silver badge

Re: @Suricou Raven, you owe your english teacher an apology.

The code above may well result in a Fatwa against you, how will you know??

1
0

Re: @Suricou Raven, you owe your english teacher an apology.

If you run the code through Translate a few more times, along the same lines as

http://www.youtube.com/watch?v=vMTKEDl-hco

would you eventually end up with the code for Microsoft Windows or some such I wonder?

0
0
Trollface

Re: @Suricou Raven, you owe your english teacher an apology.

باستخدام مساحة الأمراض المنقولة جنسيا؛

translates to: using the area of sexual transmitted diseases

0
0
Anonymous Coward

Re: @Suricou Raven, you owe your english teacher an apology.

You seem to have a problem - your # and {} are at the wrong ends of the lines, as is your <iostream> and your <<ENDL...

0
0
Boffin

Re: @Suricou Raven, you owe your english teacher an apology.

well... to accommodate the latests god google

..,,,,,─────,,,,,.

/ .. \

/ / \\.. \、

| // .____ 丶 ヽ

| ./ \ \ ヽ|

ヽ/ /::..,,,,,. ,,,,,,.::.\ ヽ|

ヽ!!l::.”⌒`.:i i::’⌒`ヾ.!!|iiiヽ../

;〈..⊂・⊃| |:⊂・⊃.:::〉iii/

\!!, …//| |ヾ\…..:,;;iii/

`lir…. /(,,∪,,)\…Yiiii/

;!iiii彡━━ミll,,lllli<

;;llllllllllilllllllllilllllii; \

/;llllllllllllllllllllllllll;ヽ |\

_/ヽ ,;lllllllllllllllllllllll; | |…..|\_

::::;| ヽヽ,illlllllllllllllllllllll!゙.| |::::::|::

Apparently that's the guy, can I haves virgins now?

Boffins, cause I read it on the internets.

0
0
Thumb Up

Re: @Suricou Raven, you owe your english teacher an apology.

Yeah, I noticed the right-left problem. But I'm as lazy as the next one, so my "google translate" stands....until I get 9/11'ed that it.

0
0
Meh

It's probably too much to ask

...but I would have definitely appreciated it had he cleaned the dirt from under his fingernails prior to recording that segment.

It's really quite revolting.

1
0
Silver badge

Comments from Chinese coders please?

Can any Chinese programmers/coders tell us about their early learning experiences of coding in English? Was it a confusing experience and did they wish they could use Chinese characters instead? Has a Chinese character coding tool been developed?

As others have already said, the words 'if', 'then', 'else', 'for', ...etc are symbols with a rigidly defined meaning and could be replaced by any other combination of symbols to make code that does exactly the same thing.

2
0
Silver badge
Happy

Re: Comments from Chinese coders please?

".....Has a Chinese character coding tool been developed?....." A friend from uni wrote his own C compiler in Chinese in his final year. It still used the standard English phrases, just the equivalent Chinese character set. He even wrote a script to convert source code files in English into Chinese chars, just so we could see what our programs looked like. A bit pointless in the long run, I suppose, but a bit amusing at the time.

1
1
Anonymous Coward

What bollocks

Have you watched the video? The guy's a complete idiot.

"The first programming language which is a conceptual artpiece" Yeah. Much in the same way this comment of mine on El Reg is one. Oh look I just farted, make it two.

"The language can express any kind of computation" ...unlike any other Turing-complete programming language. I love the way he then proceeds to demonstrate Hello World... on a REPL. YAWN!

"A big part of قلب was, could you really build a language that doesn't use the latin alphabet?" Wow, a tough challenge. Worthy of Turing award, to be sure.

Why did you give this clown any space on the Register?

9
3
This topic is closed for new posts.

Forums

Biting the hand that feeds IT © 1998–2017