C Programming/History
On the road to C
[edit | edit source]The Fortran project was developed in 1954 by IBM. A shortening of "The IBM Mathematical Formula Translating System", the project had the purpose of creating and fostering development of a procedural, imperative programming language that was especially suited to numeric computation and scientific computing. It was a breakthrough in terms of productivity and programming ease (compared to assembly language) and speed (Fortran programs ran nearly as fast as, and in some cases, just as fast as, programs written in assembly). Furthermore, Fortran was written at a high-enough level (and thus was machine independent enough) to become the first widely adopted programming language. The Algorithmic Language (Algol 58) was derived from Fortran in 1958 and evolved into Algol 60 in 1960. The Combined Programming Language (CPL) was then created out of Algol 60 in 1963. In 1967, it evolved into Basic CPL (BCPL), which was the basis for B, which was created in 1971, and served as the basis of C.
Created by Ken Thompson at Bell Labs, B was a stripped-down version of BCPL that was also a compiled language (see User's Reference to B) used in early internal versions of the UNIX operating system. As Dennis Ritchie noted in his Development of the C Language :
The B compiler on the PDP-7 did not generate machine instructions, but instead 'threaded code', an interpretive scheme in which the compiler's output consists of a sequence of addresses of code fragments that perform the elementary operations. The operations typically — in particular for B — act on a simple stack machine.
Thompson and Ritchie improved B, and called the result NB. Further extensions to NB created its logical successor, C. Most of UNIX was rewritten in NB, and then C, which resulted in a more portable operating system. The portability of UNIX was the main reason for the initial popularity of both UNIX and C. Rather than creating a new operating system for each new machine, system programmers could simply write the few system-dependent parts required for the machine, and then write a C compiler for the new system. Since most of the system utilities were thus written in C, it simply made sense to also write new utilities in C.
The American National Standards Institute began work on standardizing the C language in 1983, and completed the standard in 1989. The standard, ANSI X3.159-1989 "Programming Language C", served as the basis for all implementations of C compilers.
Improving C
[edit | edit source]The C standard has been updated every few years since its publication. New versions clarify issues in previous standards, add new features for compiler and standard library authors to support, or remove unsafe features that have long been avoided by developers. Versions are usually referred to with a Cxx abbreviation, where xx is the last two digits of the year in which the version was written.
Notable versions of C include:
- C95, which improved support for multi-byte strings for international text
- C99, which added a floating-point math library and many new language features
- C11, which focused on Unicode, memory safety, and cross-platform multithreading
- C23, which backports many keywords and syntax improvements from modern C++
As of writing, the work-in-progress next version of the standard is called C2Y, but will likely follow the same naming pattern once it is complete.
When a new version of the C standard is published, most compilers will already support some or all of it! This is because most "new features" are really standardizing extra features that became widely adopted across development environments.