6 ms·
As someone with an interest in both linguistics and programming, I’ve often wondered what programming languages would be like if they had developed from an aggl
by bradrn 6y ago
As someone with an interest in both linguistics and programming, I’ve often wondered what programming languages would be like if they had developed from an agglutinating language like Cree rather than the mostly isolating languages of western Europe. English sentences and phrases consist mostly of isolated words joined together by syntactic words: ‘Lie down on the table’. This has carried over to the programming languages we use, which mostly consist of isolated keywords and operators joined together by syntactic rules. e.g. a ‘translation’ of the previous example into Smalltalk-ish pseudocode would look something like:
you lieDown; position: (table onTopOf)
Contrast this to languages like Cree — or Ojibwe, since I can’t find a convenient Cree example — where this sentence becomes as follows, with the verb becoming the central element of the sentence and each word inflected describing its relationship to the others (Valentine 2001):
Zhngishin doopwining.
you lie prone on the table
I’d be really curious to see how a native speaker of such a language would design a programming language — I’m not sure what it would look like, but I suspect it would look remarkably different to the ones we usually use. Corbett’s languages look like an interesting step in this direction, and I’d be interested in knowing more details if they’re available.
- tgv 6y agoI doubt it. Natural language agglutination tends to have all kinds of nasty side effects, modifying the letters at the boundary, which makes parsing hard and therefore would have created problems writing a decent parser in the early days. COBOL famously tried to follow English syntax, but most other languages deviate from it. Look at early languages such as RPG or SNOBOL. They follow the machine instruction set much more closely than the English grammar. But look at your smalltalk example: does that look like English syntax? First, the word order is wrong, and second, "onTopOf" already is a concatenation. It doesn't really support the idea that your native language shapes your programming.
- bradrn 6y ago> Natural language agglutination tends to have all kinds of nasty side effects … Oh, sure; morphophonological processes do tend to mess up everything. (This is why Valentine doesn’t give a morpheme-by-morpheme gloss of the example I included.) This is why I don’t claim that such a programming language will be _exactly_ like human agglutination — only that it will have a very different structure to our languages. The complexities of human languages will always need to be simplified and regularised in order to create a programming language. > But look at your smalltalk example: does that look like English syntax? First, the word order is wrong, and second, "onTopOf" already is a concatenation. I agree that Smalltalk syntax doesn’t look at all like English syntax, at least in terms of word order. (If anything, it looks a lot more like Burmese.) And it is true that early languages like RPG and SNOBOL — and I should include assembly here as well — have little to do with any human language. But that’s not the central component of my claim. What’s important here is that, for most if not all modern programming languages, you can construct a syntax tree, like this: ┌────────┴─────────┐ │ ┌─────┴────┐ ┌──┴──┐ │ ┌──┴──┐ you lieDown; position: (table onTopOf) This is a very English-like trait, in that English sentences also consist of isolated words organised in a syntax tree: ┌───┴───┐ │ ┌──┴───┐ ┌──┴─┐ │ ┌──┴──┐ Lie down on the table This structure is of course common crosslinguistically, but agglutinative and polysynthetic languages such as Cree are structured differently. In these languages, words are composed of a stem, surrounded by affixes expressing their relationships to other words. e.g. Koasati verbs (which are reasonably straightforward in this regard) have the following structure (Kimball 1985): incorporated.noun - directional - instrumental - distributive - indirect.object - direct.object - specific.locative - general.locative - 1A.prefixes - STEM - adverb - diminutive - intention - ability - mood - deduction - modality - dubitative - hearsay - auditory - tense - consequence - sent.func = enclitics Due to this extensive marking, word order is extremely free; in many languages with this amount of marking, words within a sentence may be arranged in pretty much any order. Though linguists can still draw out syntax trees for these languages, it is unclear to what extent such an abstraction is useful: the affixes within a word have a rigid and non-hierarchical order, while the words themselves have few constraints on ordering. This is a characteristic unlike all programming languages I am aware of, and is what I refer to when I say that programming languages today are more like English and French than they are like Cree and Koasati.
- scroot 6y agoThis is a very interesting post, thanks for sharing. If you come across anything definitely give us an update