Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Hello world: meet قلب (Qalb) a programming language based on Arabic (2013) (theverge.com)
63 points by segasaturn on Feb 15, 2024 | hide | past | favorite | 31 comments


In the 80’s Sakhr and Microsoft created Arabic Basic. I just found it emulated online

https://www.file-hunter.com/Arabic/index.php?id=sakhrbasic

I think these non-English programming languages are “neat” but ultimately toys unfortunately.


Thank you for correctly adding the Q. Writing it as "alb" is the equivalent of transliterating "having a laugh" by someone from London to "avvin a lorf."


In which Arabic dialect/languages does qalb not have a q or g sound? I guess it doesn't become k to not confuse with "dog" right?


Levantine, excluding Bedouins and Alawites and some others. Egyptian Arabic supplements the Q with a glottal stop.

> I guess it doesn't become k to not confuse with "dog" right?

Qaf (Q) is usually turned into گ‎/gaf (G) in some accents (gulf, bedouin levantine). Kaf (K) is sometimes turned into چ‎/che (CH) in the northern Gulf accents. It's not very common at all for a Q to drift its way into a K and is usually considered mispronunciation.


https://github.com/nasser/---/ is the repo for it -- sadly doesn't seem it has been updated much since the initial article and release of it.


A more updated branch: https://github.com/mz0in/Qalb


Related:

قلب: a non-ASCII programming language written in Arabic - https://news.ycombinator.com/item?id=21352508 - Oct 2019 (623 comments)

Ramsey Nasser's Arabic programming language artwork - https://news.ycombinator.com/item?id=7700691 - May 2014 (108 comments)


It seems rather limiting to make a single language in a different script. Instead, would it make sense to have a language transpiler to convert the Arabic into Latin (primarily English) for all modern languages?

For instance, write your Rust code in native Arabic using native keywords, run the transpiler, and you get regular English-anchored Rust code?

This would be far less limiting than using a single language.


Depends on what your goals are: collaborating in a multi-lingual environment or exploring the abstractions that might feel more "native" to the language (or languages) in the new script.

Natural languages are abstractions in both similar ways and distinct ones that programming languages are. There are probably interesting programming languages to be discovered by developers whose first language is something other than English working on programming languages closer to their native language's abstractions. I don't have specifics to offer, just a general academic sense that diversity of thought/models is interesting and can produce interesting results given a chance.


I think this misses the point. Having a different language be just glorified syntactic sugar on top of "regular English code" is exactly what they're advocating against.

Qalb seems to be more of an art piece anyway, asking us to consider how it would feel to be English speakers interfacing with a paradigm built from the ground up in a different script or cultural tradition.


Right-to-left switching is a problem, because your eyes will have to jump all the time.


Getting PTSD from looking at code written by a former employer's Israeli and Indian dev teams at the same time.

We'd have comments in Hebrew, Indian English, and American English all over the place.


Right, but my point is that with transpilers, you rarely look at the transpiled code, only the original code. All original code would be in native tongue.


I don't know about Arabic but in Urdu the numbers are still written left to right. I found that extremely annoying when I was studying Urdu.


Urdu uses the original digit writing direction. Numbers are written little-endian in Arabic, and when Latin adopted the Arabic digits the direction of the digits was kept which made the numbers big-endian in Latin.

The users of Latin scripts are used to big-endian numbers and think this is the natural order. But historically numbers are actually little-endian with the writing direction changed around them in Latin scripts.

Now I want a snippet that flips numbers to little-endian and uses direction markers to show them the "right" way visually. This would only be a little confusing :-)

Update: My LLM got it right on the first try:

    function reverseDigitsAndCorrectDirection(inputString) {
        const regex = /-?\d+(\.\d+)?/g;
        const reverseString = str => str.split('').reverse().join('');
        return inputString.replace(regex, match => 
        '\u202E' + reverseString(match) + '\u202C');
    }


wow i've never thought of endianness as handedness, it's less esoteric that way.


I have a personal theory that if you know Arabic language- or any other language that are considered “hard” to learn like Chinese or Japanese-, if you know it, then you are going to learn programming languages quicker than the average. Would love to see if there are studies to support that but I have seen it personally.


Searching "sapphire whorf hypothesis" + programming will probably yield some relevant results. My psych a rusty, I remember example include Chinese monosyllable numbers easier in "chunk" in short term memory, so enables greater mental computation in some contexts.


So cool!

Maybe someone will write a parser to convert x language -> English valid python (or any language, just starting simple)

Shouldn't be terribly difficult with some help from AI:

https://chat.openai.com/share/14d4b7b2-fb87-4887-803e-0ecee7...


It would be amazing if you could write a python script in any language/typeface and it parse/compile and run in cpython.

I think its feasible just having all the keywords translated, the new PEG parser should bee able to handle it. I wonder if it can do rtl languages?


just posted above.. my hand-made one from 10y ago: https://github.com/svilendobrev/smok

i guess it all can be automated - using certain dictionary both ways..


This makes me think of the atrocity that is localized Excel functions. Disgusting


Inshallah, no bug


me-too: https://github.com/svilendobrev/smok

it was intended for kids and non-programmers.. but never happened any further.


me-three: (no repo)

Back in '84 (or '85), I created a variant of C with everything in Greek. Most of it could be done in the preprocessor, but I remember having to modify the compiler for something (maybe function names for the linker?).

It was surprisingly easy, compared to rest of the Unix parts that could not handle anything non-ASCII...


How's the Unicode support?


Probably still easier to read than Perl. ;)


Perl code is as hard/easy to read as any other PL unless it's about one-liners. Which were intended for use in terminal for admin work mostly and later evolved into a kind of art (or sport, depending on how you look at it)


(2013)


Added. Thanks!


[flagged]


None of this on Hacker News, please.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: