Week 5: What Even Is A Translation?
As I’ve advanced further into the project, I’ve been thinking about some more conceptual questions regarding what this project is all about. One being, what even is a translation? I didn’t think much about this question at first, but over time I’ve seen that the answer can be very nebulous. Programs can output the same values, but operate in vastly different ways; is this a translation? Even among spoken/written languages there is no consensus. Translating common conversations may be easy, but translating something like poetry is much more complex. In theory, a translation should preserve the exact meaning of the original text. Usually this just means the meaning of the words, but with something like alliteration being maintained, it may not be possible to find a word that matches the schema and preserves meaning. For example take a sentence fragment like “four friendly felines.” Depending on the context its being used in, this may be used to convey different meanings. One being a literal description, which can easily be translated to a different language by finding individual words with the same meanings and stringing them together. But the speaker may also intend for the alliteration of “f” to be a part of the meaning of the phrase. Similarly, some common proverbs or expressions in English may not carry the same meaning in a different language. Take the phrase “blood is thicker than water,” which is commonly understood to be saying that the connections to ones family should hold more importance than other connections. But if this phrase were to be translated literally, the meaning would be lost, and it would solely be understood as a fact describing the relative density of specific liquids. A translator may have to make compromises to maintain both a rough sense of the literal meaning of the phrase, while also maintaining other implied meanings or linguistic devices. Is one translation necessarily better than the other when the translator doesn’t have insight into the author’s mind and original intentions?
Since a “translation” originally referred to translating sentences between two different spoken or written languages, a translation of a programming language would presumably be somewhat similar. Regular languages and programming languages may share some similarities, but programming languages differ in that there is an intermediary behind some abstract logic, and the final utterances. English is defined by its grammar rules, whether that be the meaning of words, or the way that these words should be put together. If you change either piece of this you would get a completely different language. Because of these grammar rules, any spoken sentence can be said to either follow these rules and be considered English, or not follow these rules and be something different (obviously this is not a completely rigid structure, a sentence with typos should still be considered English (albeit not “proper”), but if something were to radically differ from the rules it wouldn’t be English). The same is true of programming languages. Each programming language has certain rules that have to be followed. For example, a language like Java has to have all statements end in a semicolon, and anything that doesn’t is no longer a valid Java program.
But the way that programming languages are different is that middle layer of an interpreter or compiler. An interpreter is the way of codifying the symbolic rules into something a machine can parse. Even if a passage were to contain no punctuation, someone would still have some sense of what statements fit together, but a machine doesn’t have this kind of insight. The interpreter relies of the semi-colons to exactly mark where each statement begins and ends, and the program is illegible without them. The interpreter or compiler does more than this though. It converts each program into extremely specific instructions for the CPU to execute. This is essentially a ledger looking up a function like “print” and then outputting what more basic code represents that function. Something similar could be said to exist within humans, where a word can trigger very specific neurons in the brain to generate an understanding in a person. But this “ledger” in the brain is unknown to outsiders and is radically different from brain-to-brain. In programming languages this is less so, and the interpreter can be modified to create a slightly modified ledger.
I started thinking about this after changing a BrainF interpreter to behave in a significantly different way. In BrainF, it’s specified that every cell can contain a number up to 255, anything above that should overflow back to 0. Piet does not have a similar restriction, and can include numbers up to infinity (or up to the integer limit because of practical memory management). To smooth the conversion of Piet to BrainF I thought it would make sense to remove this cap from BrainF. In my thinking, I felt that the cap was arbitrary, and removing it left a language that behaved in nearly the same way. Despite this thinking, the interpreter was changed, so this could arguably be considered a different language, or variant of BrainF.
As I mentioned in the blog post for Week 2, I feel there’s some sort of connection between the project I’m working on now, and the book “Godel Escher Bach: an Eternal Golden Braid”. And this seems to be in more ways than I originally realized. Similar questions around linguistic translation are also asked in Hofstadter’s book, and came to mind as I started to think more about what I intend this code to do.