It frustrates me when I hear people dismiss the differences between computer languages. There really isn’t any difference between languages, the argument goes, because “all Turing complete language differ solely on syntactic sugar.”
That’s a direct quote from part twelve of Michele Simionato’s excellent The Adventures of a Pythonista in Schemeland, but I’ve got no beef with his articles. Like I say, they’ve been an excellent introduction to Scheme for me. However, I’ve seen this particular assertion — “all programming languages are the same because they’re all Turing complete” — used repeatedly as long as I’ve been a programmer. It drives me nuts.
Sure, it’s true on a technical level. Any computer language we write gets interpreted and compiled down to machine code, so at a practical level a C program with a for(;;) loop and a Python list comprehension might end up with the same values flowing over my registers and the same instructions dropping into the CPU. But this reductionist view of programming completely ignores the incredibly important role that language plays in thought.
The traditional view of languages — human or computer — is that they’re a tool we use to express thought. But modern literary and linguistic theory holds that it’s a two way street: our thought drives our language, but the language we use leaves an indelible imprint on our thought processes. I’m not a linguist, but from what I can tell the Sapir-Whorf hypothesis is the main designator for this idea of language influencing thought.
There’s no question in my mind that this applies full-force to software development: different languages make it easier or harder to conceive of certain types and classes of algorithms. So-called “syntactic sugar” can make a big difference in efficiency: one language might naturally lend itself to writing a something close to the theoretically optimal case, while another might lead you towards a different, less efficient, solution.
Most importantly, though, is the way that computer languages intersect with our own thoughts. You’ll often a developer talk about how his favorite language “fits my brain” or “matches the way I think.” As a group of analytical types, we often dismiss these types of assertions in favor of more quantitative measurements of performance or memory consumption. But that’s a huge mistake: we’ll always be more productive in a language that promotes a type of thought with which we’re already familiar.
Comments:
See also: http://en.wikipedia.org/wik...
"
According to the theory of neuroplasticity, thinking, learning, and acting actually change both the brain's physical structure, or anatomy, and functional organization, or physiology from top to bottom.
"
In other words, what you think changes what you *will* think.
I've been thinking about this a lot recently. Did you know that Conway's Game of Live is Turing complete? Did you know that certain arrangements of Wang Tiles are Turing complete? Wang Tiles! I could write a rule book that was Turing complete, as long as you read the book according to its rules.
Are human beings Turing complete?
Does Turing completeness mean that all of these things are the same? If you could emulate me with a Python program, does that mean I'm functionally equivalent to the Ruby interpreter? Who needs Lisp? I have seven billion Wang Tiles to play with!
Written like a man who loves language -- human, computer, or otherwise! :)
I agree with all you've got here. It does seem to me that in the great langauge debate, we often forget that computer languages are for humans, not computers. Which I think is really what proponents of this "it's all turing complete" logic are saying, that to the computer it's all the same. Of course computers don't care what language we use, but they aren't the ones doing the programming now are they?
I'm always a bit skeptical when I hear Sapir-Whorf bandied about. It's a hypothesis romantic sociologists love, and linguists seem disinterested in. It's the idea the romanticists *want* to be true. If we had more words for snow, we could look out our winter windows and see a whole new world! But we actually already have lots of words for snow: heavy, light, fluffy, icy, sleet, thick, deep, powder, flurry, blizzard, drifting, wet, dry... we don't have any poverty of terms. Is it language that drives how we look at the snow, or do we use language with the same depth as our interest? The magic of language -- programming languages included -- is we build new ideas from component pieces.
There's nothing particular inferior about reusing a common set of attributes to describe the things around us. As an analog, I've yet to see any syntax that looks useful that involves "native" XML in a language -- the object systems most languages use work fine for XML already.
Jacob, you did Michele a disservice by only partially quoting him, and ended up making him say the opposite of what he was actually saying. A more complete quote is:
"The second effect (dismissing macros) is less serious: lots of people understimate macros as mere syntactic sugar, by forgetting that all Turing complete language differ solely on syntactic sugar."
He seems to have the same consideration as you of "syntactic sugar" reductionism; he's not saying that differences among programming languages are insignificant: he is lamenting those that say so.
Yup, it's one thing to say all languages *accomplish* the same thing (communicating) vs. all languages are "the same." Sapir-Whorf has some truth to it, though it is always possible to break out of a limited way of thinking. I believe your choice of the word "influences"is more accurate than the stronger view of Sapir-Whorf. Learning another language can expand our way of thinking, and we can bring those ideas into the language we are using. It's like introducing an accent of functional style programming into mainline Algol-derived languages. Though programming is different than natural language. Less flexible due to strict rules suitable for parsing. It's not quite as easy to transliterate a word, or transfer an idea.
Ian: like I say, I'm not a linguist. I've only been exposed to Sapir-Whorf in passing (I think it came up in relation to something by Chomsky I was studying, maybe?). Still, there has to be *something* to the idea that language influences thought, right? If not, how exactly would poetry ever work?
I think Nathan nailed it by talking about how learning a new language (human or computer) "can expand our way of thinking." That makes the most sense to me; certainly my functional programming chops are far improved for having learned Haskell, as are my grammar skills for having learned Latin.
Nicola: I thought I was pretty clear that I was deliberately using this particular snippet out of context as a jumping-off point; no offense to Michele was intended. Sorry if I didn't make that clear!
I' ve thought a lot about this subject as well. I wrote about this back in college; it is very scrambled and I will put a summary here; http://ericholscher.com/blo...
Basically I was thinking about the same thing, languages. Most languages are the same, and whether we're writing real languages or programming languages, we are writing for a certain thing. Programming languages we write on the 'hardware' of computers, Spoken languages we write on the 'wetware' of the brain.
Getting a language to fit your brain is what I think of as fluency in spoken language. They certainly say that spoken languages allow you to think a certain way (There are words in german that we can't express etc.). So I feel the same should hold true for programming language.
So, this might be the answer to my question "why do I prefer Python over any other language?". But I am asking it for more than 5 years and I am reluctant to pass it "as is". Have to think about this.
> If you could emulate me with a Python program
What do you mean “if”? I’m pretty sure it’s just `import noah`.
One counter to Sapir-Whorf is the phenomena of having a word on the tip of your tongue - that is the presence of an idea without any associated word. When writing, who doesn't struggle with this constantly, matching our sentiment to our expression? That tension represents ideas driving language.
But Sapir-Whorf seems appealing because of our tendency to narrate our experience when we're reflective, leading to a bias where we believe the narration is the actual thought, when in reality we are just retroactively applying language to our thought. That's less true with computer languages, as we all have an auxiliary language (i.e., natural language) which we can use to talk about programming.
Of course that doesn't mean language isn't influential. But I think language is far more of an influence is what we can express than we can think. In the case of a programming language, we're trying to get the computer to accurately perform our intended actions. In spoken language we're trying to express a sentiment to other people. Again, very different -- the computer relationship is very asymmetric, while at the core of our interpersonal communication there is empathy, allusions to shared experiences, anecdotes.
I think Sapir-Whorf is far too crude to really help us think about the subtle and self-referencing nature of thought and expression. There's something there, but Sapir-Whorf ain't it.
As to Chomsky, his Universal Grammar is almost a kind of Turing Complete notion for language (though his Grammar is based on empirical concerns, while Turing Completeness is strictly mathematical, and these are deeply different epistemologies). I assume thus Chomsky does not agree with the hypothesis.
To use an anecdote: 20 words for snow isn't that many (nor is it an anecdote based on fact), and I personally have no trouble thinking of snow that way (I've been around a lot of snow), but I imagine other cultures have a lot of ways of talking about sand. I cannot appreciate those distinctions. If you gave me many words to describe sand, I still would not really appreciate the distinctions. Sand metaphors would not connect very deeply with me. This capacity for understanding sand is based on my *experience*, not on language. If I spend more time around sand I'll understand the distinctions, with our without language.
Or, an anecdote from programming: when I was young I spent far too long programming using GW-BASIC. I say "too long" because I had badly outgrown the language, and unlike QBasic the language was badly stunted. When I started using C I found functions to be this incredible relief -- I had been creating functions using GOSUB and naming conventions, and complex ways to achieve recursion. But functions were a relief because I immediately recognized them as the-thing-I-had-been-wanting. GW-BASIC kept me from *using* the right technique, but it didn't keep me from *wanting* the right technique.
Ian, I think you're close to something there. I think this distinction you're drawing between language and ideas is one where you're smart enough to think of the-think-you-had-been-wanting. Not everyone is. Maybe you're smart enough to think of some things you want, but not all of them. (This reminds me of the chestnut about any fool being smart enough to build a box he can't figure out how to open.)
I think that aside from the primary purpose of conveying an speaker's ideas, language has a secondary effect of introducing the listener to peripheral ideas and assumptions. Put another way, talking to someone who speaks the language from a different knowledge base, you can't help but come across interesting questions. If someone made a joke about sand, you'd probably ask them about it, right?
So maybe language doesn't define the domain of our thoughts, but I think we can agree that different languages allow expression of specific topics more easily. And if so, maybe we can agree that language grows out of experience and use, such that speaking to someone with a different experience is likely to enlarge our own domain of expression.
Language is necessary, not sufficient, but widening.
@Ian,
> One counter to Sapir-Whorf is the phenomena of having a word on the tip of your tongue - that is the presence of an idea without any associated word.
The human brain wasn't designed or built, it was jury-rigged and bootstrapped over a couple of million years. So difficulty in expressing thought in words is a side-effect of the brain segregating thought and language production in different areas. I'd hazard that it makes the "tip-of-the-tongue" phenomenon a flaw in our brain-makeup comparable to "deja-vu."
(Side note: One of the courses I took in linguistics required us to look at the tragic case-studies of people suffering from aphasia. It was an amazing look at how decoupled parts of the brain are, particularly in areas we consider intrinsic to thought and language)
A difficulty in making an analogy between human language and a programming language is that the latter is highly defined and obviously mechanistic, while the former is difficult to describe mechanistically and categorization is very very messy. Human language is all over the place brain-wise.
Back on topic, I can't help but think that Turing equivalence pretty much misses the point in understanding programming language differences. Consider the difference in interacting with a computer using a mouse versus a pressure-sensitive tablet: You could certainly emulate the feature-set of a Wacom table using a mouse, but being able to emulate is not the equivalent --in human-terms-- of saying they are the same.
Sapir-Whorf vs Church-Turing: FIGHT!
Yep - "Familiarity breeds content." which leads to productivity.
asdasdasd
asdasd
ss
Leave a comment: