Reflexivity of Programming Languages

From TimPenner.ca
Jump to: navigation, search

You should read the related concept, linguistic reflexivity, before consuming this. The part about using language to describe language is especially important.

Story time: when I was in college (early 70's), I came to the conclusion that a programming language that cannot be used to define itself isn't really a programming language at all. Computer programmers know what I'm talking about when I say this but most others don't.

Programming languages consist of two things: a set of rules that define the language itself and a computer program whose purpose is to convert a text constructed according to those rules into something that a computer can act upon. Rules are defined so that a text created according to the set of rules is intelligible to a suitably knowledgeable person. This accounts for the fact that computer programmers can create descriptions of how a computer should behave - texts that are the source of computer programs. There is actually a modicum of uncertainty in the translation process because the text conversion process can be quite complex, with many possible solutions to the problem of conversion. When there is more than one conversion program available, they maybe behave similarly, but rarely identically.

Now, think about what having a converter computer program means. It means that the rules for discerning and converting the text are encoded in the converter. And like any other computer program, the converter started out as a text that was, itself, converted. Now, among all the possible computer programming languages, which ones are suitable for encoding the conversion rules of other programming languages? Actually, lots of them. Further, consider that you could encode the rules for a programming language in the self-same programming language. In fact that's how programming languages progress. Language developers develop languages largely with the same languages.

This property of many computer languages to be self-defining is what reflexivity of programming languages is about.

However, we're not quite done yet. I just explained us into a chicken and egg problem. How did the first language creator create a programming language without a programming language in which to encode the converter? The answer is that there's no such thing as a computer that doesn't have a programming language associated with it. That is, the central processing unit (CPU), the electronic device that processes the base language in a computer system, understands it's own unique machine language that is built into it. It is possible to create a program in that machine language any number of ways, starting with somebody putting the data that represents that language, by hand, into the memory of the computer. Tedious, yes. It's more likely with new computers these days, that someone programmed another computer to generate code for the target computer.

Now, we're done.

Personal tools
Namespaces

Variants
Actions
Navigation
Contact
Areas Intros
References
Tools