Computer program

This is an old revision of this page, as edited by Andres (talk | contribs) at 08:47, 22 May 2004 (et:). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A computer program (often simply called a program) is an artifact that describes computations, and possibly actions that are to be carried out based on the results of those computations.

A computer program can be manifested in several forms:

The last of these usages is the one most strongly associated with the term "computer program", and in fact the term "program" is often used as a synonym for "software". When manifested in the appropriate hardware or software, a program becomes directly executable; that is, the program's embodiment can compute and act autonomously, without human intervention.


In colloquial language words program and software used as a synonyms for software application.

Running a Program

To run a program, the computer is initialized to a starting state by loading the program and perhaps the data and then some mechanism to begin is invoked. At the lowest level this is begun with a boot sequence.

In most computers, an operating system loads and executes programs. In this context, a computer program refers to the individual executable image rather than all the programming currently running on the computer.

The Von Neumann Architecture

In a computer with the most common Von Neumann architecture or Harvard architecture the program is loaded from a peripheral device of some kind, often a hard drive. In a machine following the Von Neumann architecture, the program is loaded into main memory. The instruction sequence are then executed in order until a jump or branch instruction is executed or an interrupt occurs. These instructions change the program counter.

A computer program consists of a set of instructions that the computer understands. A computer of this architecture without a program does absolutely nothing.

The instructions in a computer program are in machine code; they are usually originally written in a computer programming language, and translated to machine code using a computer program called a compiler or an interpreter. Sometimes the programming language is simply a set of abbreviations for the machine code instructions, called assembly language -- in this case, a program called an assembler is used to make the translation.

Neural Networks

In neural network computers, many computing units with many connections between these units work in concert to solve problems. While there are many architectures following this general model, the programming of these computers often consists of weights on each connection and thresholds within the nodes. As the machine 'learns', these weights and thresholds change. In most neural networks, the learned state can be saved and later restored, making it a computer program.

Some neural networks learn from scratch every time they are turned on, and don't have programs, per se.

Virtual Machines

Many programs today run in a virtual machine. An idealized instruction set is created on top of the actual instruction set of the machines that run the program inside of the virtual machine. Many non Von Neumann machines exist only as simulations implemented as virtual machines and have not been constructed using hardware.

Analog Computers

In analog computers, as opposed to digital computers, the states saved are not discrete values like the zeros and ones of most common computers, but are rather saved as a more continuous value. For example, in the Water integrator the initial state was set by setting valve flow rates, and the amount of water in various containers of the machine.

Certain insectoid autonomous robots are good examples of this type of computer that has no program in the classic sense. They are hard wired and learn from their environment.

Programs and Data

Some speakers distinguish between data that describes a computer program and data that does not describe a computer program; the former is called a "program", and the latter "data". However, this distinction between "program" and "data" is difficult to describe precisely, since all data can be regarded as implementing a program, depending on how it is processed.

Some computing paradigms provide especially steep challenges to this distinction. The weights in a neural network are a form of "data" stored in the network, yet it is precisely these weights that (combined with the topology of the network) define the network's behavior. It is therefore unclear whether these weights serve as "program" or mere "data". Analog computers present similar challenges: should the water stored in a water integrator be regarded as program or data?

In the face of this difficulty, some speakers deny that the distinction between program and data is not that useful. This denial has a long history in computing, and is especially common in the programming cultures of Lisp and other programming languages that provide strong support for metaprogramming.

Algorithms

An abstract program is sometimes called an algorithm.

Computer programs are now also the subject of mathematics - for example, algorithmic information theory studies the behavior of idealized computers executing randomly generated computer programs.

An alternative British spelling is computer programme, although this is rare and the British spelling in this context is generally 'program'.

Development

See also