kip: A programming language based on grammatical cases of Turkish
32 points by Sietsebb
32 points by Sietsebb
I learnt Turkish and always loved how logical it is, I never thought of using it for programming.
There are lots of very cool features here. The Fibonacci code use bu, şu and o as the variable names, which are the three Turkish words for "this" / "that", which is nice as it gives you 3 variable names. The Fibonacci code is pretty readable for any Turkish reader, with just a few programming artefacts visible (brackets and indentation).
To translate this bit:
(bu tam-sayıyı) (şu tam-sayıyı) (o tam-sayıyı) işlemek,
(onla 0'ın eşitliği) doğruysa,
durmaktır,
yanlışsa,
bunu yazıp,
şunu (bunla şunun toplamını) (onla 1'in farkını) işlemektir.
In English, a very direct translation (which sounds a bit more wooden than the original Turkish does):
To process (this integer) (that integer) (the-other integer),
if equality of the-other with 0 is true,
stop
if false,
write this, and
process that (the sum of this with that) (the difference of the-other with 1)
The use of grammatical case to determine subjects and give flexibility with ordering is also very neat.
doğruysa / yanlışsa is a neat pair of keywords.
Programming has permeated enough of our linguistic culture that “if / else” doesn’t seem weird any more, but in 1960 it was definitely stilted and unidiomatic English. There are a few languages that use alternative keywords, such as “unless” in BCPL and Perl, or “otherwise” in Miranda and Haskell. But it was really hard to come up with natural idiomatic English keywords for conditional statements, and it’s amusing that we ended up with a word that was awkwardly translated from German.
Given how it's already using this, what would a good keyword for working with classes? here maybe? Or just go without it as Java?
That's very very cool and extremely my jam.
This is (as admitted by the author) a toy language. There's no way to write this if you don't know Turkish (or use an LLM).
How long until the Sinitic language area comes up with their own programming language based on characters and other linguistic intrinsics that is not a toy language but becomes load bearing? The fact that most programming keywords are in English is a historic accident that does not need to hold true going forward.