News for hackers. Stuff that matters.
Re:قلب: a non-ASCII programming language written in Arabic by fxj on Friday October 25, 2019 @08:25AM (#21354257)
This is valid python3, try it out.

  數字 = 23
  運行 = True
  假 = False
  整數=int
  輸入=input
  印出=print
  while 運行:
    猜測 = 整數(輸入('輸入一個數字: '))

    if 猜測 == 數字:
        印出('恭喜, 你猜對了.')
        運行 = 假 # 這會讓循環語句結束
    elif 猜測 < 數字:
        印出('錯了, 數字再大一點.')
    else:
        印出('錯了, 數字再小一點.')
  else:
    印出('循環語句結束')
  印出('結束')
See:

http://reganmian.net/blog/2008/11/21/chinese-python-translat...

Re:قلب: a non-ASCII programming language written in Arabic by thesuperbigfrog on Friday October 25, 2019 @08:54AM (#21354464)
You can write Perl in Latin or Klingon:

Latin from https://metacpan.org/pod/release/DCONWAY/Lingua-Romana-Perli... :

  use Lingua::Romana::Perligata;
 
  adnota Illud Cribrum Eratothenis
 
  maximum tum val inquementum tum biguttam tum stadium egresso scribe.
  da meo maximo vestibulo perlegementum.
 
  maximum comementum tum novumversum egresso scribe.
  meis listis conscribementa II tum maximum da.
  dum damentum nexto listis decapitamentum fac
      sic
          lista sic hoc tum nextum recidementum cis vannementa listis da.
          dictum sic deinde cis tum biguttam tum stadium tum cum nextum
          comementum tum novumversum scribe egresso.
      cis


Klington from https://metacpan.org/pod/Lingua::tlhInganHol::yIghun :

  use Lingua::tlhInganHol::yIghun;
   
  <<'u' nuqneH!\n>> tIghItlh!
    
  {
          wa' yIQong!
          Dotlh 'oH yIHoH yInob 
                  qoj <mIw Sambe'> 'oH yIHegh jay'!
          <Qapla'!\n> yIghItlh!
  } jaghmey tIqel!
Re:قلب: a non-ASCII programming language written in Arabic by jandrese on Friday October 25, 2019 @09:09AM (#21354547)
Congratulations! You have discovered the absolute nerdiest activity on the planet. Writing Perl in Klingon.
Re:قلب: a non-ASCII programming language written in Arabic by diegoperini on Friday October 25, 2019 @10:51AM (#21355553)
Writing Perl is enough.
Re:قلب: a non-ASCII programming language written in Arabic by ____Sash---701_ on Friday October 25, 2019 @10:25AM (#21355244)
Qapla!
Re:قلب: a non-ASCII programming language written in Arabic by lgl on Friday October 25, 2019 @11:13AM (#21355795)
I had completely forgotten about this and honestly laughed out loud. Learn some more at:

https://www.youtube.com/watch?v=auqS6FR_RDE

Re:قلب: a non-ASCII programming language written in Arabic by Apofis on Friday October 25, 2019 @04:26PM (#21358921)
We must inform the Klingons immediately.
Re:قلب: a non-ASCII programming language written in Arabic by magashna on Friday October 25, 2019 @11:26AM (#21355919)
I don't understand Latin at all but I picture a centurion dictating this to a scribe, chiseling into stone, soon to deposit it in a Flintstone-ian rockputer.
Re:قلب: a non-ASCII programming language written in Arabic by make3 on Friday October 25, 2019 @12:39PM (#21356709)
I love the Latin one, looks like a magical incantation :)
Re:قلب: a non-ASCII programming language written in Arabic by Aperocky on Friday October 25, 2019 @01:57PM (#21357521)
It's too sad the latin one is not updated since 2001, I would love to use it to write random personal pieces of code!
Re:قلب: a non-ASCII programming language written in Arabic by pgcj_poster on Friday October 25, 2019 @08:43AM (#21354381)
I don't know any Lisp, but I wonder about doing something like this in one, since if I understand correctly, even things like conditionals are functions. I'm sure it would be possible with macros, but I wonder if you make a Chinese Lisp just by redefining functions.
Re:قلب: a non-ASCII programming language written in Arabic by elangoc on Friday October 25, 2019 @09:12AM (#21354567)
Indeed!

https://elangocheran.com/2014/10/30/exploring-programming-in...

https://youtu.be/MqjMZNwnYCY

Although I started the above project around the same time as Ramsey started his project in the original link (CLisp in Arabic), they were two entirely independent things. Ramsey's project is a 100% translation, whereas my project scales to other natural languages but is not a 100% translation.

Tim and I worked on trying to make programming in other languages easier as a means to help more kids learn programming, and learn FP the Lisp way, which we explain as more natural.

https://www.youtube.com/watch?v=Y3-53JoGPE4

https://power-turtle.com/#freestyle

Re:قلب: a non-ASCII programming language written in Arabic by wostusername on Friday October 25, 2019 @10:41AM (#21355400)
Conditionals are not functions in Lisp. They are 'special forms' since they have to control the evaluation of their arguments and functions always evaluate all their arguments.

So, if you want to translate a lisp into another language you have to resort to macros.

Re:قلب: a non-ASCII programming language written in Arabic by p_l on Friday October 25, 2019 @11:59AM (#21356264)
None and none, as what you need is to alias the symbols for most lisps.
Re:قلب: a non-ASCII programming language written in Arabic by wostusername on Friday October 25, 2019 @03:16PM (#21358275)
Been a while since I've done Lisp seriously, but I don't believe that's possible, at least in Common Lisp (SBCL). While if responds to symbol function:

  * (symbol-function 'if)
  #<CLOSURE (:SPECIAL IF) {1000C5084B}>
SBCL refuses to set that value to an alias:

  * (setf (symbol-function 'foo) (symbol-function 'if))
  #<THREAD "main thread" RUNNING {10005205B3}>:
    #<CLOSURE (:SPECIAL IF) {1000C5084B}> is not acceptable to (SETF SYMBOL-FUNCTION)
Trying this with regular functions works as intended:

  * (setf (symbol-function 'bar) (symbol-function 'mapcar))
  #<FUNCTION MAPCAR>
  * (bar #'1+ '(1 2 3))
  (2 3 4)
Special forms are, well, special and a lot of the regular parts of lisp doesn't work with them.
Re:قلب: a non-ASCII programming language written in Arabic by p_l on Sunday October 27, 2019 @08:20PM (#21373382)
hmm, I think worst case symbol-macro should work there :/

I expected specials to work in this case, but apparently not.

Re:قلب: a non-ASCII programming language written in Arabic by kazinator on Friday October 25, 2019 @05:25PM (#21359395)
Yes; alias the symbols that are macro operators or special operators via macros, and alias other kinds of symbols in their respective namespaces.

Variables may also have to be done with macros, because you want an assignment to a translated variable name to appear in the original variable. Some Lisp dialects perhaps allow a variable cell to have a binding to two or more symbols which could do the same thing.

Re:قلب: a non-ASCII programming language written in Arabic by JoBrad on Friday October 25, 2019 @09:31AM (#21354701)
Uses English grammar, though.