home | blog | music | github | twfarland@gmail.com

Learning by translating

25 March 2011 Berlin

When we translate something, we usually do so to extend its reach, like translating a book from one natural language to another, or porting a program to another platform.

But the process of translating the representation of a thing has another effect – it forces the translator to consider the underlying structure of the thing more closely than they might normally, by seeing it from a different angle.

I’m interested in the use of translation as a learning aid, especially for building insight. For example, a mathemathics student may draw a graph for a function in an attempt to get a feel for the ‘shape’ of the underlying principle.

Not only does the translator build their instinctive grasp of the thing translated, they may also sharpen their understanding of the syntax, semantics and idioms of both source and target media.

In addition, translation is a creative act, often requiring inventiveness, and that the translator take ownership of the matter. So is a good mental exercise in general.

Conditions

There are some other criteria for successful learning-by-translation:

  1. The translator must have a working knowledge of both source and target media
  2. The source and target media must be different enough that the mind is meaningfully engaged in the interpretation effort.
  3. …but they must also be similar enough that any correspondence is intelligible. Translating Plato’s Republic into a performance art piece involving peacock feathers, electronic bleeps, and tins of mushy peas might not be so enlightening.
  4. Little insight may be gained when a translation is superficial. A word-for-word translation between natural languages, if it is possible at all, is often almost useless, greatly distorting (and at times, even reversing) the intended meaning. The interpretation must be done at many scales of focus, i.e. on the scale of word, sentence, paragraph, and overall argument.

The key step is to extract the kernel of the source thing, what it is trying to do or say, what its intended effect is, what its purpose is. This is difficult because the kernel is being accessed via the particular vocabulary of the source medium, but once accessed, the words by which access was given must be cast aside, then new words from a different vocabulary must be used to re-espouse it.

This is like using a ladder to climb up to the roof, kicking the ladder out from under you, seeing the view, then building a new ladder with different materials before you can descend and report what you saw up there.

An algorithmic example

This example is a little contrived but should serve to describe the value of translation. There is a clever method for finding the greatest common divisor of two given numbers in few steps:

For two natural numbers larger and smaller, their greatest common divisor is equal to the greatest common divisior of smaller and the remainder of larger divided into smaller.

From HTDP

This doesn’t express a method for finding the greatest common denominator as much as it defines a relationship between numbers.

For me at least, understanding this relationship by prose alone is difficult. There is too much to take in at once. I need to translate it into a form I find more suitable for describing processes, such as a functional programming language like Haskell. In doing so, I will get a clearer picture of the relationship.

For two natural numbers larger and smaller…

larger smaller

…their greatest common divisor is equal to…

gcdiv larger smaller =

…the greatest common divisior of smaller and the remainder of larger divided into smaller.

gcdiv larger smaller = gcdiv smaller (rem larger smaller)

Ok. Now it is clearer that the body of the relationship involves a reference to its own definition.

I can also see that the recursion must involve smaller numbers each at each level.

Assuming a divisor must be an integer, then we must follow the recursion down until we get an integer. Using 36 and 24 as larger and smaller:

gcdiv 36 24 
= gcdiv 24 (rem 36 24)
= gcdiv 24 12
= gcdiv 12 (rem 24 12)
= gcdiv 12 0
= 12

Stepping through the process in Haskell like this has given me a clear picture of what is actually going on in a way that would have been difficult by reading prose alone.

By the way, here is the full definition in Haskell. It has some extra controls – we make sure it only accepts two integers, takes the first as largest, and returns an integer when smaller is 0:

gcdivisor :: Int -> Int -> Int
gcdivisor n m = 
    let gcdiv larger smaller
            | smaller == 0 = larger
            | otherwise = gcdiv smaller (rem larger smaller)
    in gcdiv (max n m) (min n m)

A musical example

Carla (my bandmate in Daybed) and I had been talking about doing a cover. Daybed’s sound was originally based on DIY 80s synthesizer music. We could have covered plenty of bands in that genre and of that time, but we felt that might be a bit redundant (see Condition 2).

Carla is also into 60s pop, and introduced me to a nice little gem by The Zombies‘Girl, help me’:

We thought it would be fun to try reinterpreting this in a synthy manner. Instrumentally and stylistically, it was certainly different to our normal fare, but had a certain minimalism and pop sensibility in common.

Through many listenings and experiments, we decomposed the song into its constituent instrumental parts and tried to just play them back in our sound. The initial attempt, a direct translation, sounded unnatural. I then tried to block out some of the details and formal characteristics of the original so the underlying feel would be more apparent, then re-interpret that feel within the minimal synth style. Kicking the ladder away, and making a new one.

We ended up with:

Girl, Help Me by daybed

In the process, we felt we had learned a bit about songwriting because reiterpreting the original necessitated we listen more carefully to how it was composed than we might have during casual listening.

Translations within a single medium

A medium is quite fuzzy, so you don’t even need to leave its bounds to look for translation opportunities – you can get a different perspective by translating between styles within the same language.

Here is a basic ‘map’ function in javascript, in recursive style:

function map (f, arr) {
    return (arr.length === 0) ? [] : 
    [f(arr[0])].concat(map(f, arr.slice(1,arr.length)));
}
//(this style is not performant in js)

And in a more imperative style:

function map (f, arr) {
    result = [];
    for (i=0; i<arr.length; i++) result.push(f(arr[i]));
    return result;    
}

This translation shows a border of abstraction in this particular language – that of the function. These two functions yield the same result, but construct it by rather different means. Knowing multiple ways of achieving the same thing in a medium is valuable, because one might be more appropriate than another in a given situation.

Translating to a subset of the medium

When you explain something to a child, or explain something about which you have domain knowledge to a layperson, do you notice that sometimes you see the thing with more clarity? In your efforts to simplify, you abstract, and when detail is suppressed, the general shape is more apparent.

In Growing a language, Guy Steele gives a masterful display of the use of self-imposed constraints to enhance clarity. It is long, but well-worth it, especially for programmers. A bit of the way into it, you will get a real surprise. I don’t want to spoil it, just watch it.

so’i cmalu fagri puca’o jelca ne’i le zdani

For really deep explorations of media, you might be able to invent a language whose main purpose is something other than to be used as a practical means of communication.

There is a tradition of esoteric programming languages, in which Brainfuck is the most famous. It was written as an attempt to make the smallest possible compiler for the Amiga OS, version 2.0. Here is a Brainfuck program to print Hello World!

>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>>>++++++++[<++++>-]
<.>>>++++++++++[<+++++++++>-]<---.<<<<.+++.------.--------.>>+.

Looks pretty weird eh? But I bet its creator, Urban Müller, bought himself some serious computer science insights by designing it.

Linguists have made constructed and experimental languages like Toki Pona, and Lojban, which were designed to test linguistic theories such as Linguistic Relativity. The title of this subsection is Lojban for “Several small fires were burning in the house.”

To some extent, artists of all kinds usually attempt to invent their own style/language, or at least extend a base style/language as part of their expression.

In essence, the act of thinking what a particular language might be (by inventing it), gives insight into the nature of language in general, and reveals the limitations of languages in common use.