Friday, May 02, 2003

What's the Program?

Here's a little quiz you can take at home. When I talk about a computer program, what do you consider the definitive program? What's the real thing, and what's a secondary artifact? Specifically, do you think that the source code of a program is the real program, or is it the executable?

Okay, it was a bit of a trick question; I think it's neither. I think that the real program is the act of execution. Thinking back to the Turing Machine, we've inheriteted the idea of a string of symbols as a program. In fact, the Turing Machine was a step ahead, since it could dynamically rewrite the program as it executed. But the advent of the so-called Harvard architecture, in which data and code was separated, was the beginning of the process that froze programs into unchanging, unchangeable entities. And while a host of programming languages do offer the ability to dynamically change a program, today they are relegated to laboratories or museums. (Or laboratories in museums.)

We need to start thinking more dynamically: a program is a process, not a set of immutable laws. Once we start thinking about it as process, there are other things we can start to consider: the role of feedback; learning; more dynamic error recovery (more on this in a couple of days); debugging as a process of diagnosis and intervention into a complex dynamic, and potentially chaotic, system. In fact, the very idea that a program is a file is one so basic that we don't even think about it. But there's no physical law that says they have to be, and it's just one of the mirrors of illusion that imprison us in this world of suffering.