From the beginning of the computer age, computer sci- entists have grappled with the fact that writing programs in any computer language, even relatively high-level ones such as FORTRAN or C, requires painstaking attention to detail. While language developers have responded to this challenge by trying to create more “programmer friendly” languages such as COBOL with its English-like syntax, another approach is to use the capabilities of the com- puter to automate the task of programming itself. It is true that any high-level language compiler does this to some extent (by translating program statements into the under- lying machine instructions), but the more ambitious task is to create a system where the programmer would specify the problem and the system would generate the high-level language code. In other words, the task of programming, which had already been abstracted from the machine code level to the assembler level and from that level to the high- level language, would be abstracted a step further.
During the 1950s, researchers began to apply artificial intelligence principles to automate the solving of mathemat- ical problems (see aRtificialintelligence). For example, in the 1950s Anthony Hoare introduced the definition of preconditions and postconditions to specify the states of the machine as it proceeds toward an end state (the solution of the problem). The program Logic Theorist demonstrated that a computer could use a formal logical calculus to solve problems from a set of conditions or axioms. Techniques such as deductive synthesis (reasoning from a set of pro- grammed principles to a solution) and transformation (step- by-step rules for converting statements in a specification language into the target programming language) allowed for the creation of automated programming systems, primarily in mathematical and scientific fields (see also pRolog).
The development of the expert system (combining a knowledge base and inference rules) offered yet another route toward automated programming (see expeRt sys-
tems). Herbert Simon’s 1963 Heuristic Compiler was an early demonstration of this approach.
a
PPLicationsSince many business applications are relatively simple in logical structure, practical automatic principles have been used in developing application generators that can cre- ate, for example, a database management system given a description of the data structures and the required reports. While some systems output code in a language such as C, others generate scripts to be run by the database manage- ment software itself (for example, microsoft Access).
To simplify the understanding and specification of prob- lems, a visual interface is often used for setting up the appli- cation requirements. Onscreen objects can represent items such as data files and records, and arrows or other connect- ing links can be dragged to indicate data relationships.
The line between automated program generators and modern software development environments is blurry. A programming environment such as Visual Basic encapsu- lates a great deal of functionality in objects called controls,
which can represent menus, lists, buttons, text input boxes, and other features of the Windows interface, as well as other functionalities (such as a Web browser). The Visual Basic programmer can design an application by assembling the appropriate interface objects and processing tools, set properties (characteristics), and write whatever additional code is necessary. While not completely automating pro- gramming, much of the same effect can be achieved. Further Reading
Andrews, James H. Logic Programming: Operational Semantics and Proof Theory. New York: Cambridge University Press, 1992. “Automatic Programming Server.” Available online. URL: http://
www.cs.utexas.edu/users/novak/cgi/apserver.cgi. Accessed April 14, 2007.
“Programming and Problem Solving by Connecting Diagrams.” Available online. URL: http://www.cs.utexas.edu/users/novak/ cgi/vipdemo.cgi. Accessed April 14, 2007.
Tahid, Walid, ed. Semantics, Applications and Implementation of Program Generation. New York: Springer-Verlag, 2000.
awk
This is a scripting language developed under the UNIx operating system (see scRiptinglanguages) by Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger in 1977. (The name is an acronym from their last initials.) The lan- guage builds upon many of the pattern matching utilities of the operating system and is designed primarily for the extraction and reporting of data from files. A number of variants of awk have been developed for other operating systems such as DOS.
As with other scripting languages, an awk program con- sists of a series of commands read from a file by the awk interpreter. For example the following UNIx command line:
awk -f MyProgram > Report
reads awk statements from the file myProgram into the awk interpreter and sends the program’s output to the file Report.
L
anguageF
eaturesAn awk statement consists of a pattern to match and an action to be taken with the result (although the pattern can be omitted if not needed). Here are some examples:
{print $1} # prints the first field of every # line of input (since no pattern # is specified)
/debit/ {print $2} # print the second field of # every line that contains the
# word “debit”
if ( Code == 2 ) # if Code equals 2, print $3 # print third field
# of each line
Pattern matching uses a variety of regular expressions famil- iar to UNIx users. Actions can be specified using a limited but adequate assortment of control structures similar to awk
those found in C. There are also built-in variables (including counters for the number of lines and fields), arithmetic func- tions, useful string functions for extracting text from fields, and arithmetic and relational operators. Formatting of out- put can be accomplished through the versatile (but some- what cryptic) print function familiar to C programmers.
Awk became popular for extracting reports from data files and simple databases on UNIx systems. For more sophisticated applications it has been supplanted by Perl,
which offers a larger repertoire of database-oriented fea- tures (see peRl).
Further Reading
Aho, Alfred V., Brian Kernighan, and Peter J. Weinberger. The Awk Programming Language. Reading, mass.: Addison-Wesley, 1998.
goebel, greg. “An Awk Primer.” Available online. URL: http:// www.vectorsite.net/tsawk.html. Accessed may 22, 2007.
Babbage, Charles
(1791–1871) British
Mathematician, Inventor
Charles Babbage made wide-ranging applications of math- ematics to a variety of fields including economics, social statistics, and the operation of railroads and lighthouses. Babbage is best known, however, for having conceptualized the key elements of the general-purpose computer about a century before the dawn of electronic digital computing.
As a student at Trinity College, Cambridge, Babbage was already making contributions to the reform of calcu- lus, championing new European methods over the New- tonian approach still clung to by British mathematicians. But Babbage’s interests were shifting from the theoretical to the practical. Britain’s growing industrialization as well as its worldwide interests increasingly demanded accurate numeric tables for navigation, actuarial statistics, inter- est rates, and engineering parameters. All tables had to be hand-calculated, a long process that inevitably introduced numerous errors. Babbage began to consider the possibil- ity that the same mechanization that was revolutionizing industries such as weaving could be turned to the auto- matic calculation of numeric tables.
Starting in 1820, Babbage began to build a mechani- cal calculator called the difference engine. This machine used series of gears to accumulate additions and sub- tractions (using the “method of differences”) to gener- ate tables. His small demonstration model worked well, so Babbage undertook the full-scale “Difference Engine
Number One,” a machine that would have about 25,000 moving parts and would be able to calculate up to 20 dec- imal places. Unfortunately, Babbage was unable, despite financial support from the British government, to over- come the difficulties inherent in creating a mechanical device of such complexity with the available machining technology.
Undaunted, Babbage turned in the 1830s to a new design that he called the Analytical Engine. Unlike the Difference Engine, the new machine was to be programmable using instructions read in from a series of punch cards (as in the Jacquard loom). A second set of cards would contain the variables, which would be loaded into the “store”—a series of wheels corresponding to memory in a modern computer. Under control of the instruction cards, numbers could be moved between the store and the “mill” (corresponding to a modern CPU) and the results of calculations could be sent to a printing device.
Collaborating with Ada Lovelace (who translated his lec- ture transcripts by L. F. menebrea) Babbage wrote a series of papers and notes that explained the workings of the pro- posed machine, including a series of “diagrams” (programs) for performing various sorts of calculations.
Building the Analytical Engine would have been a far more ambitious task than the special-purpose Difference Engine, and Babbage made little progress in the actual con- struction of the device. Although Babbage’s ideas would remain obscure for nearly a century, he would then be rec- ognized as having designed most of the key elements of the modern computer: the central processor, memory, instruc- tions, and data organization. Only in the lack of a capability
B
to manipulate memory addresses did the design fall short of a modern computer.
Further Reading
“The Analytical Engine: the First Computer.” Available online. URL: http://www.fourmilab.ch/babbage/. Accessed April 20, 2007. Babbage, Henry Prevost, ed. Babbage’s Calculating Engines: A Col-
lection of Papers. With a new introduction by Allan g. Brom- ley. Los Angeles: Tomash, 1982.
Campbell-Kelly, m., ed. The Works of Charles Babbage. 11 vols. London: Picerking and Chatto, 1989.
“Who Was Charles Babbage?” Charles Babbage Institute. Avail- able online. URL: http://www.cbi.umn.edu/exhibits/cb.html. Accessed April 20, 2007.
Swade, Doron D. “Redeeming Charles Babbage’s mechanical Com- puter.” Scientific American, February 1993.