Bubbles_glow

≡ Literary Systems ≡

 
Corner_fold
  • Citation
  • Extension
  • Response
  • Comment
Hopo_catalog
 
Flowchart_grey_24

Simplicity is Relative

The difference between literary systems can be seen in tell-tale signs. One of the most obvious is the ease or difficulty with which a particular meaning may be expressed. Simplicity is relative. What is easy to say in one system can be quite difficult to put together in another.

Natural languages have extensive literary systems surrounding them, which is one of the things that makes translation such a difficult effort. What do you do when you run up against a literary form that has no ready-to-hand equivalent? Circumlocution, that's what my old Spanish teacher used to advise. In an interview with Richard Kostelanetz, the author José Ferrater Mora compares a passage that he had originally written in Spanish with his English translation:

"What happens here? Let me give an example. I heard a number of times the Argentinian writer Borges being interviewed. He always makes the same claim that you cannot say much in Spanish. He always deplores that he is not an English writer, and he always claims that you cannot say in Spanish a number of things that you can say in English. Well, I would say that he is right but you can reverse the case. You cannot say in English a number of things that you can say in Spanish. And that particular passage, I think, is interesting. I mean, it is an insignificant passage, but I think it is linguistically interesting. There is something you can say in Spanish here and it's perfectly well and it's quite ordinary, patética estenografia, which in English would be ridiculous. So in English you have to say something like a dramatic setting. On the other hand, in Spanish you have sobre la cosa montaba el hecho; in English you have to say something to translate the concept —something like the dramatic setting in which the event occurs, which is literally not interesting at all. Well, I have found, my experience is that sometimes it goes both ways. I mean sometimes I find something in English which I find absolutely impossible to say in Spanish with the same degree of vividness and color. But also the other way around. And that happens on the conceptual level rather than on the descriptive level."

The situation is also present (if not far more extreme) in the realm of programming languages. Some things that are absolutely trivial to express in one language become almost impossible to say in another, or at least quite wordy. To start things off, here's the basic concept of iteration expressed in Java:
public List getIds(List items) {
List result = new ArrayList();
Iterator itemIterator = items.iterator();
while (itemIterator.hasNext()) {
item = (Item) itemIterator.next();
result.add(item.getId());
}
return result;
}

The same idea, expressed in Ruby, would look like this:
def get_ids( items )
items.map { |item| item.id }
end
Clearly the Ruby code has a far higher density of meaning, when talking about iteration. But there are some areas in which comparing languages reveals results that are miles apart. Paul Graham, a strong advocate of the idea that density of meaning is what gives programming languages their power, gives us the example of a function that takes a number n, and gives you back a function which will add n to another number. Well, in C, a relatively low-level language, you can't do it without building up fantastic machinery to make returning a function possible, thousands of lines of code at least. C has no literary form for first-class functions, as they're called. In Ruby, Graham's function looks like this:
def plus_n( n )
lambda { |num| num n }
end



 
In "Succinctness is Power", he writes:

"My hypothesis is that succinctness is power, or is close enough that except in pathological examples you can treat them as identical.

It seems to me that succinctness is what programming languages are for. Computers would be just as happy to be told what to do directly in machine language. I think that the main reason we take the trouble to develop high-level languages is to get leverage, so that we can say (and more importantly, think) in 10 lines of a high-level language what would require 1000 lines of machine language. In other words, the main point of high-level languages is to make source code smaller.

If smaller source code is the purpose of high-level languages, and the power of something is how well it achieves its purpose, then the measure of the power of a programming language is how small it makes your programs."