Brian Ziman : English 302 N01 : Narration : Final to be Graded
|
Brian Ziman The Origins of the C Programming Language The C programming language is the building block from which the most popular modern computer application programming interfaces (APIs) and operating systems are constructed. For over thirty years, C has been maturing and changing, from its modest beginnings at Bell Labs to its ubiquitous presence in modern computing. Since the late 1990s, application programming has turned largely to object-oriented programming languages, encouraged by the standardization of C++, the introduction of Java, and the recent development of the new C# language by Microsoft. Despite the popularity of these newer incarnations and derivatives of C, modern operating systems, such as Linux and Mac OS X, and Microsoft's WIN32 API are still largely implemented in standard C. Therefore, it is interesting to examine the history and origins of the C programming language, to discover the motivations behind it, and the influences upon its creation. The C programming language found its beginnings at Bell Laboratories in the late 1960s as part of the project to develop a new operating system called Unix for the PDP class of mini-computers from the Digital Equipment Corporation. At that time, system programming was done in assembly language for the machine it was to be run on. This presented a number of challenges to the programmers. The first and most pressing challenge, is that assembly language is extremely difficult to read, write, debug, and understand. In 1968, Ken Thompson began developing the Unix operating system for the PDP-7 machine, writing the first version entirely in assembly language. Once the first version was written, he realized that a more useful high level system programming language was required to build utilities and applications that are necessary on any useful system. The language he developed to meet this requirement was the "B" programming language. The B programming language was based on the Basic Combined Programming Language (BCPL) developed by Martin Richards a few years earlier, in 1967, at MIT. Thompson was constrained by the limits of the PDP-7 machine, and had to condense BCPL into a smaller language with fewer moving parts. Nevertheless, Thompson retained the procedural flavor of BCPL, and its closeness to the machine architecture, with a clear correlation between the language constructs and the corresponding assembly language code. Like BCPL (and unlike C), B only provided a single data type, called a "word", that was typically the same size, in bits, as the data bus of the computer. The other major challenge in using assembly language for developing operating systems is its inherent lack of portability. That is, work done on one machine in assembly language must be completely redone when moving it to another machine. By using a higher level language, such as the B programming language, the programs can be moved from one machine to another without major revisions. Only the compiler - the program that converts the text of a high level program into the native machine language of the new system - must be rewritten to support the new machine. This is a much simpler task than rewriting the entire operating system and all of the applications and utilities. One of the other features of the B language that helped make it portable was its lack of built-in routines for interacting with the hardware. Functions such as reading from and writing to the terminal are not built in to the language, but are defined as part of a library. These lowest level functions must be rewritten in assembly language for a new platform, but these routines generally represent only a small fraction of the code present in the entire operating system. Thompson eventually rewrote the B language in itself, and added new features to take advantage of advances in hardware, as he moved from the PDP-7 to the PDP-11. But by 1971, it was clear that the B language had a number of issues that needed to be dealt with. Ken Thompson and his colleague, Dennis Ritchie, noted that having only a single data type of the size of a machine word required a great deal of overhead for handling smaller and larger pieces of data. For example, text strings were composed of a list of individual eight-bit bytes that had to be packed and unpacked from a list of sixteen-bit words that was half as long. Similarly, a floating point number could not be stored completely inside a sixteen-bit word. The IEEE standard for the shortest possible floating point number requires 32 bits of storage. On the PDP-11 (and even on the Intel 386), two words were required to store a single floating point number. B was incapable of handling this concept. Finally, because B handled pointers as an index into an array of words, instead of eight-bit bytes, each pointer operation had to be converted at runtime to the machines native format. Because of all of these reasons, starting in 1971, Dennis Ritchie began to write a new language based on B. This new language added support for a variety of types - a character type that was one byte in size, a variety of integer types, structures, and arrays and pointers to these types. Originally called NB (short for "New B") by Ritchie, it was soon renamed because "NB seemed insufficiently distinctive," and so, following Thompson's precedent, dubbed the new language "C". (Ritchie 1993)
At this point, C was still in a very early stage. Through
1973, new operators were added to the language, and operator precedence
was debated and finalized, and the pre-processor was introduced. The
pre-processor is a mechanism, still in use today, for performing simple
text substitution through directives in code before the code is
compiled, for example, In 1973, C was mature enough to allow Thompson and Ritchie to rewrite the Unix operating system in that language. It was around this time that the "standard" input/output library was defined by Michael Lesk, that allowed the portability mentioned before. Throughout the rest of the 1970s, most of the tools and utilities for Unix were rewritten in C, and Unix and C became very popular across the world of computing academia and research. The language continued to grow and change, until 1983, when the American National Standards Institute (ANSI) began a committee to define an official standard for the C programming language. This standard was eventually completed and accepted in 1989. The C programming language had grown over 20 years out of the work started by a few researchers at Bell Labs into a standard that still carries practical importance today. The language came from a practical need to have a high level language that, while flexible and easy to use, was close enough to the hardware to be efficient for system level programming, and at the same time, portable across different systems. These principles have allowed C to reach the widespread use and interest that it sees today. Works Cited "(Basic) Combined Programming Language." University of Bath. 17 Feb. 2003 <http://www.cs.bath.ac.uk/~jap/CM20168/Presentations/group-j-bcpl.pdf> "History of C++." 2000. The C++ Resources Network. 10 Feb. 2003 <http://www.cplusplus.com/info/history.html> Kernighan, Brian W., and Dennis M. Ritchie. The C Programming Language. Englewood Cliffs: Prentice Hall, 1978. Ritchie, Dennis M. "The Development of the C Language." April 1993. Bell Labs/Lucent Technologies. 10 Feb. 2003 <http://cm.bell-labs.com/cm/cs/who/dmr/chist.html> |