TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

QLB (قلب) - Program in Arabic, display algorithms as calligraphy

164 pointsby munafover 12 years ago

17 comments

mahmudover 12 years ago
Neat. I also wrote a bunch of Arabic Lisps, most toys that went nowhere :-)<p>My biggest obstacle has so far been <i>language</i> 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.<p>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.<p>Even within technical English, words like letter and character do NOT mean the same thing, though they are similar.<p>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.<p>One of my favorite games is to read a passage out, say, a type-theoretic paper and try to translate it to Arabic :-)<p>[Edit:<p>It <i>is</i> 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. لقوله، قم الليل الا قليلا<p>]
评论 #5057637 未加载
评论 #5058039 未加载
评论 #5057839 未加载
评论 #5057658 未加载
评论 #5057902 未加载
DanBC2over 12 years ago
Nice.<p>Everyone knows about algorithm, right?<p>From Wikipedia:<p>&#62; 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.
评论 #5059163 未加载
评论 #5057826 未加载
saidajigumiover 12 years ago
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]? ;-)<p>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.<p>[1] <a href="http://islamic-arts.org/2012/arabic-calligraphy-and-type-design/" rel="nofollow">http://islamic-arts.org/2012/arabic-calligraphy-and-type-des...</a> [2] <a href="http://www.typotheque.com/images/articles/thuraya/02.jpg" rel="nofollow">http://www.typotheque.com/images/articles/thuraya/02.jpg</a>
munafover 12 years ago
For the curious, Qlb means "Heart" in Arabic.<p>Here's Conway's Game of Life: <a href="http://twitpic.com/bv2cra" rel="nofollow">http://twitpic.com/bv2cra</a>
leviathanover 12 years ago
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.
jlgrecoover 12 years ago
So are programs compiled into that rendered tile format? Is this using some existing standard for transcribing algorithms into this calligraphy?<p>This looks very neat but I'm afraid I don't entirely understand it.
评论 #5058068 未加载
评论 #5057358 未加载
评论 #5057256 未加载
philhippusover 12 years ago
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.
评论 #5057663 未加载
评论 #5057585 未加载
评论 #5058339 未加载
killahpriestover 12 years ago
Try this if you're stuck:<p>(قول "مرحبا يا عالم!")<p><pre><code> قول = say مرحبا = hello/welcome يا = oh عالم = world</code></pre>
评论 #5057997 未加载
il_dementeover 12 years ago
If you are interested in Arabic programming languages then this will be a treat ;)<p>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.<p>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.<p>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: <a href="https://code.google.com/p/kalimat/source/checkout" rel="nofollow">https://code.google.com/p/kalimat/source/checkout</a><p>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.<p>I am not the author of the language, so I am not familiar with all features of this language, for more details you can:<p>1. Checkout the language's website <a href="http://www.kalimat-lang.com" rel="nofollow">http://www.kalimat-lang.com</a>.<p>2. Usage guide <a href="http://www.kalimat-lang.com/wiki/%D8%AF%D9%84%D9%8A%D9%84_%D8%A7%D8%B3%D8%AA%D8%AE%D8%AF%D8%A7%D9%85_%D9%83%D9%84%D9%85%D8%A7%D8%AA" rel="nofollow">http://www.kalimat-lang.com/wiki/%D8%AF%D9%84%D9%8A%D9%84_%D...</a><p>3. The author's blog under label Kalimat <a href="http://iamsamy.blogspot.com/search/label/kalimat" rel="nofollow">http://iamsamy.blogspot.com/search/label/kalimat</a><p>4. To begin learning the language, you can check Kalimat By Example tutorial here: <a href="http://www.kalimat-lang.com/wiki/%D9%83%D9%84%D9%85%D8%A7%D8%AA_%D8%A8%D8%A7%D9%84%D8%A3%D9%85%D8%AB%D9%84%D8%A9" rel="nofollow">http://www.kalimat-lang.com/wiki/%D9%83%D9%84%D9%85%D8%A7%D8...</a><p>Side Note: Unfortunately the language website, usage guide and the blog are written in Arabic.<p>However, these are some of the features I'm aware of:<p>- Destructuring<p>- Tail Call Elimination<p>- Lambda Expression<p>- Parallel Procedures<p>- Green Threads<p>- CSP Channels<p>- Callbacks in FFI (similar to Java's JNI, Python's ctypes and C#'s P/Invoke') which enables using external libraries and frameworks like OpenGL <a href="http://iamsamy.blogspot.com/2012/12/opengl-in-kalimat.html" rel="nofollow">http://iamsamy.blogspot.com/2012/12/opengl-in-kalimat.html</a><p>Along with primitive features like<p>- Events<p>- Defining classes with fields, Signals and Slots<p>- Defining Modules
评论 #5058983 未加载
mulliganover 12 years ago
Cool project,<p>one nit in the description: "The name قلب is pronounced 'alb "<p>in standard arabic, it is actually "qalb", some dialects happen to drop the q sound
评论 #5058124 未加载
评论 #5057726 未加载
评论 #5058681 未加载
christiangencoover 12 years ago
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.
shaunxcodeover 12 years ago
this is amazing, I created a similar hack for the "deseret" language. There is a running repl at <a href="http://deseretpl.org" rel="nofollow">http://deseretpl.org</a><p>It has multiple levels of authentication - highest is:<p>user: elohim pass: melk<p>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).<p>QLB is much cooler in that it seems to be make semantic sense.
NelsonMinarover 12 years ago
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?
pointernilover 12 years ago
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 ...
bamdaddover 12 years ago
Why its not right to left and aligned to left ?<p><a href="https://github.com/nasser/---/blob/master/public/lib/amthila/konway.qlb" rel="nofollow">https://github.com/nasser/---/blob/master/public/lib/amthila...</a>
评论 #5057552 未加载
hfahimover 12 years ago
Thats artistic.. how did you overcome RTL support ?
评论 #5058102 未加载
Issamover 12 years ago
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?