1. 11

After learning some Chinese and reading through Aditya Mukerjee’s “করো: Translating Go to Other (Human) Languages, and Back Again” slides from Golang 2017, I was reminded again of the curious resemblance of Chinese classifiers (especially measure words) to a type system of sorts.

I was wondering if anyone here had done any reading on comparisons, what we can learn, or whether any experimental programming languages had been implemented using natural language classifiers.


  2. 7

    In the other direction, there’s the Grammatical Framework that uses dependent types to translate among multiple languages.

    I used GF to build a small webapp to improve my Swedish vocabulary while I lived there. The code would generate random sentences in both Swedish and English and I’d enter the translation and check my input against the GF translation.

    1. 1

      Wow, that’s neat. Did you open source it, by any chance?

      1. 1

        Please share this with us. Would love to see it

        1. 1

          Sadly no, I think it’s gone forever. Probably wouldn’t be hard to recreate it though.

      2. 6

        There is a lot of study in linguistics relating to this stuff. Oftentimes, linguists are logicians and type theorists are all speaking the same language. That said, linguists often have the harder job unless they start turning into a logician or type theorist since actually classifying how human languages really work is pretty hairy.

        1. 1

          Any links or pointers to relevant materials?

        2. 5

          There’s quite a rigid type system implemented in Sanskrit. I wrote a high-level overview of it a few years back. Sanskrit has gone on to, indirectly, give rise to the Backus Normal Form.

          1. 2

            An interesting question. Linguistically mapping of word classes (Part-of-Speech) to grammatical rules can be considered a type system of sorts. As per programming languages, we could look to theory as early as COBOL (possibly earlier?), as one of its primary goal was to mimic natural language:

            The desire for readability led to the use of English-like syntax and structural elements, such as nouns, verbs, clauses, sentences, sections, and divisions. [0]

            I am not sure those could count as types though, as it reflects syntax.

            [0] https://en.wikipedia.org/wiki/COBOL#Verbose_syntax

            –EDIT– Actually, ignore almost everything I said. The more I think about it, this isn’t what you seem to be looking for. Word Classes indeed are syntax oriented and have no inner type per high level rules. There are emergent behavioral rules for types of things like measurements and labels when referring to nouns, but as far as I know those type classifications have not been mapped to any natural programming language.

            1. 2

              Continuations have been used to study natural language phenomena: https://www.goodreads.com/book/show/22693619-continuations-and-natural-language

              1. 2

                Some early work in this area can be found under the keyword “Montague semantics” or “Montague grammar”. That approach starts from logician Richard Montague’s hypothesis that:

                There is in my opinion no important theoretical difference between natural languages and the artificial languages of logicians; indeed I consider it possible to comprehend the syntax and semantics of both kinds of languages with a single natural and mathematically precise theory.

                Naturally it therefore brings in various things from study of “artificial languages” to natural language, including typing. However, most of the people working in that tradition are logicians, so the style of typing and terminology used tends to follow what you find in papers and textbooks on logical semantics rather than in programming language theory (but there are lots of correspondences between the two). Besides Montague’s own work, one paper in this tradition that might be interesting is “Type theory and ordinary language” by Terence Parsons (1979) (doesn’t seem to be online anywhere unfortunately).

                1. 1

                  Thank you!