Tuesday, May 06, 2003

The Unbearable Precision of Languages

Ask a programmer why people can't just program in English (or whatever natural language), and he's likely to tell you that it's because English is a naturally ambiguous language, and that computer programming requires precision. Perhaps he'll go into greater detail, and wax on about how literal computers are, and how they don't "know" what you mean, and only do exactly what you tell them to do.

As if this is some sort of bad thing! The irony comes in when we realize that we humans manage to get by using such a (by implication) terrible language, full of imprecision and ambiguity. But the ambiguity of human language has two sides of the coin: we manage despite it, and we succeed because of it.

We manage despite it because our brains, being the wonderful organs they are, can hold multiple simultaneous meanings long enough to resolve the ambiguity. If you start speaking and say "The running..." you might mean running as an adjective ("the running program", and technically it's a gerundive) or as a noun ("the running of the bulls," and a gerund). In fact, "running program" might be the program that is running now, or it might be a program that is about running, perhaps a jogging diary. The point is that when you say the first word, the hearer's brain doesn't know how to classify it yet, but manages, in real time, to hold it in place and resolve it when the additional information comes in.

We manage because of it because ambiguity is an essential element in communication. For one reason, if language wasn't ambiguous, it would by necessity be incredibly long, as all possible meanings would have to be excluded. Ambiguity lets us slide by using short hand, knowing that the recipient of the message will be able to (most likely) resolve the ambiguity correctly. Also, the ambiguity goes hand in hand with the incredible expressiveness of language: a more formal and restricted language would be less prone to ambiguity, but would limit the kinds of utterances possible.

Now there's some more irony here. In the linguistics community, the idea of the Turing Machine and computation is the best thing since sliced phonemes. They assume that the brain is doing computation. From a computer scientist's point of view, however, what the brain's doing seems impossibly more advanced than the sorts of things our Turing Machines do.

So the point is that, in principle, there's nothing stopping programmers from employing ambiguity in a useful way. Now I'm not implying that full computer comprehension of natural language is right around the corner, nor do I think that natural languages really ought to be our programming language of choice. However, we've imprisoned ourselves in a straitjacket of non-ambiguity, when it might help us express ourselves so much more clearly.

If you're more interested in linguistics, a great book to pick up is Steven Pinker's The Language Instinct.