16 comments

  • joomy 6 hours ago
    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!)

    • yowayb 3 hours ago
      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!
      • mertd 1 hour ago
        Ç is a brilliant name
    • gerdesj 4 hours ago
      "Kip (meaning "grammatical mood" in Turkish)"

      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.

      • Twey 3 hours ago
        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.

        • thaumasiotes 3 hours ago
          > because English doesn't conjugate for mood

          It does, but like some other English inflectional patterns the syntax is mostly vestigial.

          All I ask is that the two of you be polite to each other has be in subjunctive mood; if it were indicative, it would be are instead.

          Something that I find interesting is that, while conjugating verbs for mood is largely vestigial in English, the more general phenomenon of paying close attention to the relationship between the sentence and reality, the focus that mood expresses, is very much alive. It's just that it's mostly moved out of the inflectional system.

          • Twey 3 hours ago
            It has constructs for a few different moods/modes[1], but no conjugation: the morphology used to form moods is borrowed from other verb forms (in your example, the bare infinitive) that were never (as far as I know!) dedicated mood conjugations.

            [1]: pedantically they are ‘modes’ in the linguistic jargon, but often referred to as ‘moods’ in discussions of English grammar: linguistically a mood is the grammatical morphology used to signify a mode, which English lacks.

            • thaumasiotes 2 hours ago
              > It has constructs for a few different moods/modes[1], but no conjugation: the morphology used to form moods is borrowed from other verb forms (in your example, the bare infinitive) that were never (as far as I know!) dedicated mood conjugations.

              Well, this is mixing an argument about the facts with an argument about the history.

              On the facts this is a mood expressed by conjugating the verb. It obviously isn't an infinitive form because it's a finite verb. It is identical with the infinitive form, and this is a general rule of English (only observable with this one verb), but there's nothing stopping different forms from being identical, even identical by rule. In Latin the nominative and accusative case of a neuter noun are always identical.

              • Twey 2 hours ago
                Sorry, I didn't mean to confuse matters — by pulling in the etymology of the morphology I was trying to be generous to the argument. Namely, I thought there might be a chance that the bare infinitive in e.g. the conditional mood is derived from an older true mood (in the linguistic sense, i.e. a verb form that is sufficient to signify the mode), which I would consider a pretty reasonable justification for considering the bare infinitive there to be a true conditional mood, albeit one that happens to be identical to other forms. I couldn't find evidence for it though, and as far as I know it's not a common feature in other Germanic languages.

                As for the syntactic argument — I think it would usually be said not to be the case due to the periphrastic nature of the construction. That is, it's not the verb conjugation itself that signifies the mode but the combination of a conjugation (that is used in a variety of different constructions) with the ‘that’ (or ‘would’, aut cetera, for other moods). As with a lot of these things, though, it's significantly a matter of the conventional definition of terms. For instance in English grammar the ‘full infinitive’ ‹to + bare infinitive› is usually considered a conjugation even though it includes an extra particle. Go figure :)

                On that note, it's important to distinguish syntax from semantics: the term ‘bare infinitive’ doesn't mean that morphology is _semantically_ infinitive, the infinitive was just picked as the class representative to name that particular morphology, which is known as the ‘bare infinitive’ wherever it occurs. Ditto with ‘past participle’ and ‘present participle’, and especially ‘gerund’ (which is named after a grammatical function that doesn't even exist in English!).

                • thaumasiotes 1 hour ago
                  > I thought there might be a chance that the bare infinitive in e.g. the conditional mood is derived from an older true mood...

                  CGEL says this:

                  Given that the three constructions in [24] always select identical verb-forms, it is inappropriate to take imperative, subjunctive, and infinitival as inflectional categories. That, however, is what the traditional grammar does, again retaining distinctions that were valid at an earlier stage of the language but have since been lost

                  [I'm taking a position that disagrees with this one, but it does address the use of mood in earlier stages of English.]

                  I feel that that may not directly address your specific question, but it's hard to know what that question is, since English conditional clauses do not use the form you identify as 'bare infinitive'.

                  > ...an older true mood (in the linguistic sense, i.e. a verb form that is sufficient to signify the mode)

                  This doesn't make sense. A verb form is never sufficient to signify the semantic mode of a sentence. Nobody ever argues that Latin didn't have inflectional mood, but good luck identifying why a verb appears in the subjunctive if you can't see the rest of the sentence around it.

                  (There is a whole traditional taxonomy of different Latin subjunctives; the most common cases are conditional clauses, which use subjunctive mood to indicate counterfactuality, commands ("jussive subjunctive"), and wishes ("optative subjunctive"). Another case is "the verb is part of an indirect question". [Do indirect statements use subjunctive verbs? Nooooooooo...])

                  So, for English, we have a distinction in semantic modality that obligates us to use an exotically-conjugated verb. Why is this not an example of grammatical mood?

                  • Twey 40 minutes ago
                    > CGEL says this

                    On further investigation I guess that Old English did indeed have a dedicated subjective conjugation, unique at least in the plural!

                    > good luck identifying why a verb appears in the subjunctive if you can't see the rest of the sentence around it.

                    The question of _why_ a verb is in a particular conjunction is one thing; the question of _whether_ a verb is conjugated, though, shouldn't really be in doubt.

                    > A verb form is never sufficient to signify the semantic mode of a sentence.

                    In languages with conjugated grammatical mood, the conjugation is indeed enough to signify the mood of the verb, just as in languages with conjugated past tense verbs in the past tense can be recognized by their conjugation.

                    > So, for English, we have a distinction in semantic modality that obligates us to use an exotically-conjugated verb. Why is this not an example of grammatical mood?

                    I think we might be talking at cross purposes. English certainly does have (several! though the precise set might depend on whom you ask) grammatical moods (in the English-grammar sense of grammatical constructions that convey mode). I don't know of anybody who argues that it doesn't. What English doesn't have, and Turkish (as well as Latin) does, is _conjugated_ mood, i.e. a particular mutation of verbs that associates a particular mode with that verb.

      • inkyoto 3 hours ago
        A grammatical mood indicates the modality of the verb, and some languages possess rich inventories of the grammatical moods. They are called differently in different languages, but mood is an established term in English.

        English has indicative («go», «is going» etc), subjunctive / conjunctive / conditional («went» in «as if they went»), imperative («go!»).

        German has two conditional moods – Konjunktiv I and II, for example.

        Finno-Ugric languages have many more.

        • thaumasiotes 2 hours ago
          > English has ... subjunctive / conjunctive / conditional («went» in «as if they went»)

          That isn't the English subjunctive.

          You're correct that this construction expresses the same thing that another language might express by marking a non-indicative mood on the verb, but it would not conventionally be said to use a non-indicative mood. That went is a normal past-tense indicative verb and the modality is expressed by the whole structure of the clause, not just by the inflection of the verb.

          In linguistics there's a whole set of parallel vocabulary where one set is for grammatical forms and the mirror set is for the semantics usually expressed by those forms. So you have grammatical "tense" and semantic "time" or grammatical "mood" and semantic "modality". You got the modality right, but not the mood.

          Compare the conventional analysis that he will be there tomorrow expresses future time, but is not in future tense because there is no English future tense.

          • inkyoto 2 hours ago
            > That isn't the English subjunctive.

            No, it is not a proper English subjunctive (a correct example would have been «as if they were» – past subjunctive) or «[we suggested] that they go».

            I deliberately lumped subjunctive, conjunctive, and conditional together for brevity. Part of the problem is that many English speakers do not differentiate between subjunctive and conjunctive (conditional) and incorrectly label the latter as subjunctive, but that happens because English does not have a conjunctive (conditional) mood.

            English subjunctive is translated into other Indo-European languages either as the conjunctive or indicative mood, as there is no 1:1 mapping in existence.

    • araes 4 hours ago
      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:

        (5 first, 3 second, difference) write, vs
        (3 second, 5 first, difference) write  ?
      
      Google just gave back:

        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?
      • joomy 4 hours ago
        "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.

        • ronjakoi 2 hours ago
          Essentially you could write equivalent code as (vähennä 5:ttä 3:lla) in Finnish
      • andro_dev 27 minutes ago
        The Turkish sentence's expansion would be pretty much like the mathematical expansion of the expression order.
      • pinkmuffinere 3 hours ago
        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). 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

    • joomy 2 hours ago
      Okay there is an updated web page and playground now: https://kip-dili.github.io/
    • sedatk 5 hours ago
      Fantastic work, an area I’ve always wanted to explore.
    • nhatcher 5 hours ago
      Sorry! It was too beautiful not to share it. But I'm sure you can do a show HN once you think is ready.
      • joomy 5 hours ago
        That's okay, thanks for sharing!
  • tristenharr 4 hours ago
    Woah this is AWESOME! I am going to have to take a look! Love the thoughts, doing something similar at https://logicaffeine.com/studio

    Check out Logos lang, would love to chat sometime. love that you chose Haskell!

  • celaleddin 6 hours ago
    Got especially excited, since I also experimented on a similar idea a few years ago:

    https://github.com/celaleddin/sembolik-fikir

    Will check this out further in the following days. Thanks for sharing!

    • joomy 5 hours ago
      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. :)

  • Ruidy 3 hours ago
    I have been learning the language because my girlfriend is Turkish.

    Now I can use my programming brain to fast forward the learning.

    Amazing

    • biddit 3 hours ago
      Yep, this was a skillset combination I never envisioned. (am married to a Turk). Maybe a good reason to push past the intermediate plateau.
  • hexfran 6 hours ago
    Not relevant to the language itself but to the grammar: https://languagelog.ldc.upenn.edu/nll/?p=73
  • lolc 7 hours ago
    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.

    • inkyoto 3 hours ago
      > I don't know any other language where flexible argument order would work so well.

      Any highly inflected language has such a property. Slavic languages, Sanskrit (or, more broadly, Indo-Aryan languages) are prime examples.

      Speakers of Finnish and Hungarian will likely chime in and state something similar.

      • ronjakoi 2 hours ago
        Finnish case markers vary a lot from word to word, because of not only vowel harmony but other features of the word stem, and consonant gradation which is a weird feature of Uralic languages.

        For the subtraction example, some numbers would be 50:tä 5:llä and others 6:tta 3:lla. Of course you could encode for all those possibilities and successfully parse them, but it would feel weird for a compiler to reject an expression because it's ungrammatical Finnish.

        Also it would feel weird if you first write (vähennä muuttujaa 256:lla) but then realise you made an off-by-1 and have to change it to (vähennä muuttujaa 255:lla) but that doesn't compile because it should be 255:llä, so you have to remember to change two things.

        But on the other hand, that's just how it is to write in Finnish, so in prose we don't really think about it. In natural language, it's normal to have to change other stuff in a sentence for it to continue making sense when you change one thing.

    • thaumasiotes 3 hours ago
      > 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.

  • ugurs 6 hours ago
    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.
  • Twey 3 hours ago
    Those of a certain vintage might remember Lingua::Romana::Perligata: https://metacpan.org/dist/Lingua-Romana-Perligata/view/lib/L...
  • Twey 3 hours ago
    I love when the ‘language’ part of programming languages doesn't get left behind :) Very neat!
  • chuckadams 5 hours ago
    Reminds me a bit of Lingua::Romana::Perligata.
    • joomy 4 hours ago
      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
  • SuperNinKenDo 4 hours ago
    I love this kind of stuff - non-English programming languages, particularly when they utilise language features in unexpected ways like this.

    My Turkish is pretty rusty - and was never any good anyway, but really cool stuff.

  • octoberfranklin 4 hours ago
    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).

    • joomy 4 hours ago
      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.
      • octoberfranklin 29 minutes ago
        Cases essentially act like named arguments

        ... and there are only eight argument names. Which seems... limiting.

        It's different from record types in the sense that you can provide the arguments in any order to a function

        You can provide the fields of a record in any order, and call a function with it!

           f { foo=3, bar=5 }
           g { bar=5, foo=3 }
        
        I still think the page needs a Rosetta Stone.
  • hahahahhaah 5 hours ago
    A language an LLM can choke on!
  • readthenotes1 7 hours ago
  • rafohy12 7 hours ago
    [flagged]
    • alpaylan 6 hours ago
      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?
    • BigTTYGothGF 5 hours ago
      I don't even live in England but still write in English, heck of a thing if you think about it.
    • pinkmuffinere 6 hours ago
      Both developers are Turkish