Hello world: meet قلب (Qalb) a programming language based on Arabic (2013)
theverge.com
theverge.com
https://www.file-hunter.com/Arabic/index.php?id=sakhrbasic
I think these non-English programming languages are “neat” but ultimately toys unfortunately.
> 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.
قلب: 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)
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.
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.
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.
We'd have comments in Hebrew, Indian English, and American English all over the place.
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');
}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...
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?
i guess it all can be automated - using certain dictionary both ways..
it was intended for kids and non-programmers.. but never happened any further.
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...