Hi all, Kip's developer here! I was going to wait until we had finished the playground and landing page before posting about the project more, but here's the browser-based playground we have so far (thanks to Alperen Keles) for anyone who wants to play with the language: https://alpaylan.github.io/kip/
(The work on JavaScript transpilation just started today and currently doesn't work, but running the language should mostly work, though it probably has bugs, which I'd love to hear about in the repo's issues!)
I studied Turkish for a few years and remember thinking it could make an interesting programming language (due to the grammatical/agglutinative features). I was gonna call it Ç, but I was never seriously going to make it. Happy to see someone went for it!
I'm not sure what a grammatical mood is, so I tried a couple of well known translation services and got: kip == "mode". However big G did also manage "modal", "paradigm", "tense" and "module".
For my money: "tense". Just to confuse the issue, tense has several meanings in english! Here I think we are talking about a verbal tense:
In linguistics, tense is a verb conjugation to indicate temporal information, while mood is a conjugation to indicate various kinds of metainformation about the speaker's relationship to the information in the sentence. It's not as common a term as ‘tense’ when discussing English, because English doesn't conjugate for mood, but it is the standard word for describing some features of Turkish morphology such as evidentiality.
Automatic translators, while an impressive and convenient piece of technology, usually focus on providing a plausible gloss in the target language, so typically lose a lot of nuance. For looking up words a dictionary is usually a better bet; for example, Wiktionary has https://en.wiktionary.org/wiki/kip#Turkish with a link to the explanation of the English word as well.
Question on some of the syntax. It's neat, and think the idea's cool. Would definitely be something if nothing else for security through obscurity. Is it even code?
However, for some of the number stuff, if you write something like:
(5'le 3'ün farkını) yaz.
(3'ün 5'le farkını) yaz.
How does it tell whether it is:
5 - 3 = 2, or
3 - 5 = -2 ?
Does it always just return 2 because of the meaning of "farkını" and the placement of 'le and 'ün? Like:
Write (the difference between 5 and 3).
Write (the difference between 3 and 5).
Not especially familiar with Turkish, and mostly had to use translation, yet it looks like a language for defining math theorems? Number following "zero" shall be called "one", number following "one" shall be called "two". Or is that more just a feature of using natural language for the writing syntax?
Disclaimer: I grew up speaking Turkish, but never studied it. I think I can give a common-sense explanation, but can’t give a rigorous “proof” appealing to grammatical rules.
I read “(5’le 3’ün farkını) yaz” as “having 5, 3’s difference write” (of course this is not natural in English I’m trying to preserve ask the). Ie, you’re given 5, you want to take 3, and write the result. Likewise, “(3’ün 5’le farkını) yaz” would be “3’s difference, having 5, write”. Again we are given 5, and want 3’s difference. Because we’re starting with 5, i think there is no ambiguity in the operation to be done — start with 5, subtract 3.
Idk if that actually helps clarify it at all, maybe it gives some intuition
"fark" here takes two arguments, the first (the minuend) is in instrumental case (-le), the second (the subtrahend) is in genitive case (-in). Now, because of the suffixes of the cases, regardless of the order in which you give the arguments, the type system can figure out which one is supposed to be the minuend and which the subtrahend.
If it helps, you can think of it like named arguments where the name is inferred from the case.
That's pretty cool! From what I can tell, it does a morphological guess based on the suffix. If you didn't have the apostrophe, it'd have issues with ambiguity (say "aşı", does it mean vaccine or does it mean "aş" in accusative case?) but the apostrophe solves that problem too.
My solution for this problem in Kip was to go all the way with the morphological analysis using TRmorph (https://github.com/coltekin/TRmorph) for it, and then resolve the ambiguities in type checking / elaboration. (Therefore Kip almost never needs apostrophes.) Whether it was worth it, I don't know, but it was a fun problem to solve. :)
Clicking the link with a prejudice in my mind, I found the definitions cleverly clean and easy to understand. I would be pleased to see a German version of it, just to have a good laugh.
Haha I can read some casual Turkish and this made my day!
Funny how the case system of Turkish is both strong and standardized enough for this to work well. I don't know any other language where flexible argument order would work so well.
> I don't know any other language where flexible argument order would work so well.
What kind of sample size is that? A case system and flexible argument order are largely the same thing.
Note also that flexible argument order is a robust phenomenon in English:
1. Colonel Mustard killed him in the study at 5:00 with his own knife.
2. Colonel Mustard killed him at 5:00 in the study with his own knife.
3. Colonel Mustard killed him in the study with his own knife at 5:00.
4. Colonel Mustard killed him with his own knife at 5:00 in the study.
5. Colonel Mustard killed him at 5:00 with his own knife in the study.
6. Colonel Mustard killed him with his own knife in the study at 5:00.
But if you insist on looking in other languages, there's a famous Latin poem beginning Quis multa gracilis te puer in rosa perfusus liquidis urget odoribus grato, Pyrrha, sub antro?
Translating this as closely as possible to a one-word-for-one-word standard, it says What slender boy soaked [in] liquid odors presses you among many rose[s], Pyrrha, beneath [a] pleasant cave?
(Notes: rosa is singular for unclear reasons. There is nothing corresponding to the in of "in liquid odors"; the relationship between the odors and the soaking is expressed purely by case. There is also nothing corresponding to the article in "a pleasant cave"; Latin does not mark definiteness in this way. Location inside a cave is expressed with "beneath"; compare English underwater.)
Anyway, the actual word ordering, using this translation, is: What many slender you boy among rose[s] soaked liquid presses [in-]odors pleasant, Pyrrha, beneath [a-]cave?
I've heard that Russian poetry is given to similarly intricate word orderings.
Yes, that's one of my inspirations! I'm writing a short paper about Kip and I'm citing Perligata there for sure. The closest modern non-English programming language I know that also uses grammar features is Tampio, for Finnish. https://github.com/fergusq/tampio
It would be really helpful if this page showed side-by-side comparisons of the same program written in Kip and some other language, like say Haskell.
I'm having a hard time seeing how this is much different from record types, except that you're limited to only eight fixed record field names (one for each grammatical case).
Cases essentially act like named arguments, except the names are inferred from the case of an argument, which is inferred through morphological analysis. And that analysis can be ambiguous, so the ambiguities are solved by the type checker / elaborator. It's different from record types in the sense that you can provide the arguments in any order to a function, and the system will figure it out because of the cases.
The Maryland one (that would be me, although I haven’t really done anything except the WASM bindings, this is really all Joomy’s work, kudos to him) is vacationing in Izmir right now, why would that even be important though?
Now I can use my programming brain to fast forward the learning.
Amazing
(The work on JavaScript transpilation just started today and currently doesn't work, but running the language should mostly work, though it probably has bugs, which I'd love to hear about in the repo's issues!)
I'm not sure what a grammatical mood is, so I tried a couple of well known translation services and got: kip == "mode". However big G did also manage "modal", "paradigm", "tense" and "module".
For my money: "tense". Just to confuse the issue, tense has several meanings in english! Here I think we are talking about a verbal tense:
https://www.bbc.co.uk/bitesize/articles/zh4thbk#zyh2s82
Tense can also be synonymous with emotion: dangerous/exciting and also as a measure: tension/tight.
Automatic translators, while an impressive and convenient piece of technology, usually focus on providing a plausible gloss in the target language, so typically lose a lot of nuance. For looking up words a dictionary is usually a better bet; for example, Wiktionary has https://en.wiktionary.org/wiki/kip#Turkish with a link to the explanation of the English word as well.
However, for some of the number stuff, if you write something like:
How does it tell whether it is: Does it always just return 2 because of the meaning of "farkını" and the placement of 'le and 'ün? Like: Google just gave back: Not especially familiar with Turkish, and mostly had to use translation, yet it looks like a language for defining math theorems? Number following "zero" shall be called "one", number following "one" shall be called "two". Or is that more just a feature of using natural language for the writing syntax?I read “(5’le 3’ün farkını) yaz” as “having 5, 3’s difference write” (of course this is not natural in English I’m trying to preserve ask the). Ie, you’re given 5, you want to take 3, and write the result. Likewise, “(3’ün 5’le farkını) yaz” would be “3’s difference, having 5, write”. Again we are given 5, and want 3’s difference. Because we’re starting with 5, i think there is no ambiguity in the operation to be done — start with 5, subtract 3.
Idk if that actually helps clarify it at all, maybe it gives some intuition
If it helps, you can think of it like named arguments where the name is inferred from the case.
Check out Logos lang, would love to chat sometime. love that you chose Haskell!
https://github.com/celaleddin/sembolik-fikir
Will check this out further in the following days. Thanks for sharing!
My solution for this problem in Kip was to go all the way with the morphological analysis using TRmorph (https://github.com/coltekin/TRmorph) for it, and then resolve the ambiguities in type checking / elaboration. (Therefore Kip almost never needs apostrophes.) Whether it was worth it, I don't know, but it was a fun problem to solve. :)
Funny how the case system of Turkish is both strong and standardized enough for this to work well. I don't know any other language where flexible argument order would work so well.
What kind of sample size is that? A case system and flexible argument order are largely the same thing.
Note also that flexible argument order is a robust phenomenon in English:
1. Colonel Mustard killed him in the study at 5:00 with his own knife.
2. Colonel Mustard killed him at 5:00 in the study with his own knife.
3. Colonel Mustard killed him in the study with his own knife at 5:00.
4. Colonel Mustard killed him with his own knife at 5:00 in the study.
5. Colonel Mustard killed him at 5:00 with his own knife in the study.
6. Colonel Mustard killed him with his own knife in the study at 5:00.
But if you insist on looking in other languages, there's a famous Latin poem beginning Quis multa gracilis te puer in rosa perfusus liquidis urget odoribus grato, Pyrrha, sub antro?
Translating this as closely as possible to a one-word-for-one-word standard, it says What slender boy soaked [in] liquid odors presses you among many rose[s], Pyrrha, beneath [a] pleasant cave?
(Notes: rosa is singular for unclear reasons. There is nothing corresponding to the in of "in liquid odors"; the relationship between the odors and the soaking is expressed purely by case. There is also nothing corresponding to the article in "a pleasant cave"; Latin does not mark definiteness in this way. Location inside a cave is expressed with "beneath"; compare English underwater.)
Anyway, the actual word ordering, using this translation, is: What many slender you boy among rose[s] soaked liquid presses [in-]odors pleasant, Pyrrha, beneath [a-]cave?
I've heard that Russian poetry is given to similarly intricate word orderings.
My Turkish is pretty rusty - and was never any good anyway, but really cool stuff.
I'm having a hard time seeing how this is much different from record types, except that you're limited to only eight fixed record field names (one for each grammatical case).
https://www.euronews.com/my-europe/2024/10/25/what-is-turkis...
(276 points and 255 comments) https://news.ycombinator.com/item?id=41793485