5 ms·
Hello world: meet قلب (Qalb) a programming language based on Arabic (2013)
- elintknower 3y ago[flagged]
- dang 3y agoNone of this on Hacker News, please.
- thatwasunusual 3y agoProbably still easier to read than Perl. ;)
- broken-kebab 3y agoPerl 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)
- elliottcarlson 3y agohttps://github.com/nasser/---/ 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.
- anticensor 3y agoA more updated branch: https://github.com/mz0in/Qalb https://github.com/mz0in/Qalb
- linux2647 3y ago(2013)
- dang 3y agoAdded. Thanks!
- illusive4080 3y agoIt 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.
- cyberax 3y agoRight-to-left switching is a problem, because your eyes will have to jump all the time.
- illusive4080 3y agoRight, 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.
- alephnerd 3y agoGetting 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.
- nelblu 3y agoI 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.
- lolc 3y agoUrdu 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'); }
- someotherperson 3y agoThank 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."
- ithkuil 3y agoIn 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?
- deleted 3y ago[deleted]
- someotherperson 3y agoLevantine, 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.
- p10_user 3y agoSo 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-0ecee74ab338 https://chat.openai.com/share/14d4b7b2-fb87-4887-803e-0ecee7...
- VagabundoP 3y agoIt 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?
- svilen_dobrev 3y agojust posted above.. my hand-made one from 10y ago: https://github.com/svilendobrev/smok https://github.com/svilendobrev/smok i guess it all can be automated - using certain dictionary both ways..
- reportgunner 3y agoThis makes me think of the atrocity that is localized Excel functions. Disgusting
- dang 3y agoRelated: قلب: a non-ASCII programming language written in Arabic - https://news.ycombinator.com/item?id=21352508 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 https://news.ycombinator.com/item?id=7700691 - May 2014 (108 comments)
- soapspudster 3y agoIn 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 https://www.file-hunter.com/Arabic/index.php?id=sakhrbasic I think these non-English programming languages are “neat” but ultimately toys unfortunately.
- binary132 3y agoHow's the Unicode support?
- svilen_dobrev 3y agome-too: https://github.com/svilendobrev/smok https://github.com/svilendobrev/smok it was intended for kids and non-programmers.. but never happened any further.
- zvr 3y agome-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...
- spike_protein 3y agoInshallah, no bug
- tamimio 3y agoI 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.
- maxglute 3y agoSearching "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.