Archive for January, 2017

The Arrival, linguistic determinism, and programming languages

January 1, 2017

My son and I recently saw The Arrival, a movie that at first reminded me of Arthur C. Clarke’s Childhood’s End. The trailer suggested more action than was delivered, not a bad thing; the impact was primarily psychological.

Spacecraft arrive in several locations, hovering just above the ground. As you might guess, each country’s military forces quickly take control. The focus is on the US contingent (of course), although Australia, China and other countries are initially in frequent communication to collectively figure out what’s going on.

A sliding “door” periodically opens in the underside of each craft and personnel enter to try to make contact. Artificial gravity inside the atrium in which the humans stand makes things a little easier. A mostly opaque rectangular window separates them from the aliens and their atmosphere. The military personnel quickly realise that they need outside help so they enlist a linguist and a physicist. Apparently only America has competent linguists and physicists. 🙂

1

I won’t say more about the plot because I want to focus on one aspect and head off on a tangent. After a lot of puzzling by the main protagonists over the strange circle-based language in which the aliens try to communicate, the linguist eventually understands, with the help of a close encounter, why they have come. Nothing sinister as it turns out.

Along the way, the linguist talks to her physicist colleague and friend about the now somewhat outmoded Whorf-Sapir hypothesis (or just Whorfianism) of language or in which the structure of language is thought to affect the world view or cognition of its speakers. The weak form of this, linguistic relativity, says that a language merely influences thought, whereas the strong form, known as linguistic determinism, suggests that language determines what can be thought.

As the philosopher Ludwig Wittgenstein put it in his Tractatus Logico Philosophicus:

The limits of my language mean the limits of my world.

and

About what one cannot speak, one must remain silent.

The Arrival adds an interesting twist to this by allowing the linguist, who understands and internalises the alien language, to experience the world in a way that is, shall we say: temporally flexible.

The tangent has almost arrived; just a couple more paragraphs… 🙂

There is research suggesting that languages with names for particular colour shades make it easier for its speakers to remember those shades. This is an example of the weak form. However, we know that it is possible to perceive and describe shades, even if we have no explicit names for them, evidence against the strong form of the hypothesis.

Another example of the weak form would seem to be the fact that the Greek language has a different words for love: for God, friendship, the love of a parent for a child, and love between intimate partners.

I have not researched this enough to know whether there really are plausibly deterministic examples in natural languages, but I’d be interested in seeing some.

EDIT: It occurred to me today that I had heard of and recently read (here) about a culture whose language has only the number words one and two with many being the catch-all for other quantities. This most definitely places constraints upon the worldview of its people. In particular: the ability to count to specific numbers beyond two. It may be that in such a culture, this is all that’s required for enumeration in daily life, but it’s difficult to argue that growth is not limited by this, in particular: the discovery and use of mathematics. This is an example of linguistic determinism in natural languages.

Now finally, the tangent…

This all got me thinking about linguistic relativism and determinism in programming languages. To what extent does a programming language influence or determine what a programmer can think or limit his/her world view?

Whereas a language like assembly, C or C++ gives complete access to the hardware of a computer, Virtual Machine based languages like Java don’t, so too for explicit memory de-allocation vs garbage collection and other “unsafe” operations.

For example, not being able to express the thought in code: “write 42 to memory address 673416” limits what can be thought (programmed) in that language, an example of the strong form, so linguistic determinism.

There are of course many applications for which it is completely unnecessary (and dangerous) to be able to express such thoughts, so type systems that rule out whole classes of dangerous “code thoughts”, do us a great service, but at the cost of limiting our world and forcing us to be silent about certain things, as Wittgenstein might say, and possibly but not necessarily at the cost of performance.

Similarly, a language with even simple intrinsic data structures such as lists and maps permits more complex code with less effort. So long as suitable language constructs exist, i.e. pointers and dynamic memory allocation, such data structures (and algorithms to operate over them) can be created by the programmer, albeit at a greater cost and cognitive effort, and made available as libraries for use by others. Here we are closer to linguistic relativity I think. It was not uncommon to find myself, especially in the 90s, writing custom list data structures and search or sort algorithms from scratch when coding in the C programming language.

Perhaps the strongest encounter I had with the idea of language-as-influencer-of-thought was when learning Perl 20 years ago while working for a dial-up era Internet provider. The combination of regular expressions, lists, and maps in particular provided new ways to think about text processing, beyond simple character-by-character or sub-string comparisons.

If you had asked me 15 years ago which languages I could “think fastest” in, I would have said Perl and Java. Before them, the answer would have been C. The Perl experience translated to similar scripting languages all of which have been only incrementally better or worse, including Python.

At University I had studied and taught programming paradigms,  written a couple of compilers (e.g. ACE), engaged in some language design; I spent a lot of time in the 90s and early 2000s on the latter two.

The impact of object-oriented languages like Java and C++ (in fact, embodying multiple paradigms) was longer-lasting than most, especially with respect to the design and maintenance of large code bases. In recent years I’ve had increasing sympathy with the functional programming paradigm and strongly statically typed languages that limit the set of “legal” programs (for my own good).

As I have said in a different post, all programming languages are crude approximations of some Platonic ideal of a coming together of minds, artificial and natural, and there are very few languages yet that make communion with the machine or, just as important, with other programmers, a beautiful experience.

The idea of a programming language that doesn’t just place limits on my world, but one that radically changes the way I think about the world, as the alien language did for the linguist in The Arrival, is alluring.

I remain in search of such a language (and its ecosystem of libraries and tools), one that of course can only ever be asymptotically approached.

Writing this has scratched an itch that has been irritating me for a long time. Perhaps I’ll have more to say about particular languages and how they live up to the “ideal” in future posts.