Computer program

C-language "Hello, World" source code. This first known "Hello, world" snippet from the seminal book The C Programming Language originates from Brian Kernighan and Dennis Ritchie in 1974.

A computer program is a collection of instructions [1] that performs a specific task when executed by a computer. A computer requires programs to function and typically executes the program's instructions in a central processing unit. [2]

A computer program is usually written by a computer programmer in a programming language. From the program in its human-readable form of source code, a compiler can derive machine code—a form consisting of instructions that the computer can directly execute. Alternatively, a computer program may be executed with the aid of an interpreter.

A part of a computer program that performs a well-defined task is known as an algorithm. A collection of computer programs, libraries, and related data are referred to as software. Computer programs may be categorized along functional lines, such as application software and system software.

History

Early programmable machines

The earliest programmable machines preceded the invention of the digital computer. In 1801, Joseph-Marie Jacquard devised a loom that would weave a pattern by following a series of perforated cards. Patterns could be woven and repeated by arranging the cards. [3]

Analytical Engine

Lovelace's diagram from Note G, the first published computer algorithm

In 1837, Charles Babbage was inspired by Jacquard's loom to attempt to build the Analytical Engine. [3] The names of the components of the calculating device were borrowed from the textile industry. In the textile industry, yarn was brought from the store to be milled. The device would have had a "store"—memory to hold 1,000 numbers of 40 decimal digits each. Numbers from the "store" would then have then been transferred to the "mill" (analogous to the CPU of a modern machine), for processing. It was programmed using two sets of perforated cards—one to direct the operation and the other for the input variables. [3] [4] However, after more than 17,000 pounds of the British government's money, the thousands of cogged wheels and gears never fully worked together. [5]

During a nine-month period in 1842–43, Ada Lovelace translated the memoir of Italian mathematician Luigi Menabrea. The memoir covered the Analytical Engine. The translation contained Note G which completely detailed a method for calculating Bernoulli numbers using the Analytical Engine. This note is recognized by some historians as the world's first written computer program. [6]

Universal Turing machine

In 1936, Alan Turing introduced the Universal Turing machine—a theoretical device that can model every computation that can be performed on a Turing complete computing machine. [7] It is a finite-state machine that has an infinitely long read/write tape. The machine can move the tape back and forth, changing its contents as it performs an algorithm. The machine starts in the initial state, goes through a sequence of steps, and halts when it encounters the halt state. [8] This machine is considered by some to be the origin of the stored-program computer—used by John von Neumann (1946) for the "Electronic Computing Instrument" that now bears the von Neumann architecture name. [9]

Early programmable computers

The Z3 computer, invented by Konrad Zuse (1941) in Germany, was a digital and programmable computer. [10] A digital computer uses electricity as the calculating component. The Z3 contained 2,400 relays to create the circuits. The circuits provided a binary, floating-point, nine-instruction computer. Programming the Z3 was through a specially designed keyboard and punched tape.

The Electronic Numerical Integrator And Computer (Fall 1945) was a Turing complete, general-purpose computer that used 17,468 vacuum tubes to create the circuits. At its core, it was a series of Pascalines wired together. [11] Its 40 units weighed 30 tons, occupied 1,800 square feet (167 m2), and consumed $650 per hour ( in 1940s currency) in electricity when idle. [11] It had 20 base-10 accumulators. Programming the ENIAC took up to two months. [11] Three function tables were on wheels and needed to be rolled to fixed function panels. Function tables were connected to function panels using heavy black cables. Each function table had 728 rotating knobs. Programming the ENIAC also involved setting some of the 3,000 switches. Debugging a program took a week. [11] The ENIAC featured parallel operations. Different sets of accumulators could simultaneously work on different algorithms. It used punched card machines for input and output, and it was controlled with a clock signal. It ran for eight years, calculating hydrogen bomb parameters, predicting weather patterns, and producing firing tables to aim artillery guns.

The Manchester Small-Scale Experimental Machine (June 1948) was a stored-program computer. [12] Programming transitioned away from moving cables and setting dials; instead, a computer program was stored in memory as numbers. Only three bits of memory were available to store each instruction, so it was limited to eight instructions. 32 switches were available for programming.

Later computers

Switches for manual input on a Data General Nova 3, manufactured in the mid-1970s

Computers manufactured until the 1970s had front-panel switches for programming. The computer program was written on paper for reference. An instruction was represented by a configuration of on/off settings. After setting the configuration, an execute button was pressed. This process was then repeated. Computer programs also were manually input via paper tape or punched cards. After the medium was loaded, the starting address was set via switches and the execute button pressed. [13]

In 1961, the Burroughs B5000 was built specifically to be programmed in the ALGOL 60 language. The hardware featured circuits to ease the compile phase. [14]

In 1964, the IBM System/360 was a line of six computers each having the same instruction set architecture. The Model 30 was the smallest and least expensive. Customers could upgrade and retain the same application software. [15] Each System/360 model featured multiprogramming. With operating system support, multiple programs could be in memory at once. When one was waiting for input/output, another could compute. Each model also could emulate other computers. Customers could upgrade to the System/360 and retain their IBM 7094 or IBM 1401 application software. [15]

Other Languages
Afrikaans: Rekenaarprogram
azərbaycanca: Kompüter proqramları
Bân-lâm-gú: Tiān-náu thêng-sek
беларуская (тарашкевіца)‎: Праграма
brezhoneg: Goulev
Gaeilge: Ríomhchlár
Bahasa Indonesia: Program komputer
íslenska: Forrit
latviešu: Datorprogramma
Lëtzebuergesch: Computerprogramm
la .lojban.: selsampla
македонски: Сметачки програм
Malagasy: Fandaharana
Bahasa Melayu: Atur cara komputer
Mìng-dĕ̤ng-ngṳ̄: Diêng-nō̤ tiàng-sê̤ṳ
Nederlands: Computerprogramma
олык марий: Программе
oʻzbekcha/ўзбекча: Kompyuter dasturi
Runa Simi: Wakichi
Simple English: Computer program
slovenščina: Računalniški program
srpskohrvatski / српскохрватски: Kompjuterski program
svenska: Datorprogram
Taqbaylit: Ahil
粵語: 電腦程式