Now, probably, it is impossible to find a specialist in the IT field in the world who would not have heard about the C language. This language has gained immense popularity throughout the world and has had a significant impact on many other programming languages. That he is the predecessor of languages such as C ++, C #, Java; less known (for example J #). Microsoft has chosen C-like syntax to develop its native language to its .Net platform. Say what you like, but the C language seriously changed the life of programmers of the last century and became de facto in the field of low-level programming, leaving only those places where performance was critical.
Many people remember the names of the creators of the language - Ken Thompson and Denis Ritchie, but I decided to dig deeper and recall the history of the creation and development of the language. Anyone who is interested in this topic - welcome under cat.
The C language dates back to the ALGOL language (stands for ALGorithmic Language), which was created in 1958 in conjunction with the Committee of European and American Computer Science at a meeting in 1958 at Zurich Swiss High Technical School. The language was the answer to some of the shortcomings of the FORTRAN language and an attempt to correct them.
Inspired by the language ALGOL-60, the Mathematical Laboratory of the University of Cambridge, together with the Computer Department of the University of London, created in 1963 CPL (Combined Programming Language).
')
The CPL language was considered difficult, and in response to this, Martin Richardson created the BCPL language in 1966, the main purpose of which was to write compilers. Now it is practically not used, but in due time because of good portability it played an important role.
BCPL served as the ancestor of the Bee language, developed in 1969 by the already familiar to all AT & T Bell Telephone Laboratories, no less familiar by Ken Thompson and Dens Ritchie.
The Bee language was used to write the earliest versions of UNIX, created as a response to the Multics project, which is being developed by Bell Laboratories. This language served as the immediate predecessor of the C language.
Regarding the emergence of C language, Peter Moylan writes in his book “The case against C”: “We needed a language that could bypass some of the hard rules built into most high-level languages and ensure their reliability. We needed a language that would allow us to do something that could only be implemented in assembly language or machine code. ”C became just such a language. This led to its further popularity in such programming areas as driver writing and other aspects of low-level programming.
The C programming language was developed in the walls of Bell Labs from 1969 to 1973. As Ritchie himself admitted, the most active period of creativity was in 1972.
For all the time of its existence, the C language has become overgrown with legends about the motives of its creation.
According to one of the legends, Kernighan and Ritchie loved one computer game, which they launched on the company's main server. Later, they wanted to transfer it to a computer in the office. But he, unfortunately, did not have an operating system, which prompted Kernighan and Ritchie to write it. When they wanted to transfer the system to another computer, this turned out to be a daunting task, since the system was written entirely in assembler. Then they had the idea to rewrite it into a high-level language. At first, for these purposes, they planned to use the language of B, but due to the fact that he did not allow to fully use the new features of the computer to which they wanted to transfer the system, it was decided to create their own language.
According to another legend, the C language was an April Fool's joke, which gained serious popularity.
The C compiler inherited the tradition laid by Niklaus Wirth and was written on C himself. According to the majority, the name of the C language is the third letter of the alphabet. It appeared as an indication that the C language is more advanced than the B language. However, Ritchie himself said the following about the name of the language: “Having created a type system, an appropriate syntax and a compiler for a new language, I felt that he deserved a new name: NB seemed to me not clear enough. I decided to follow the single-letter style and called it C (C), leaving open the question whether after B this was the next letter in the alphabet or in the name BCPL. ”
C's success is mainly due to the fact that a significant part of the UNIX operating system was written on it, which eventually became very popular. If we count by the number of currently used operating systems developed on the basis of UNIX, then it is the most common system in the world. Due to its prevalence, as well as the fact that at the moment the size of the operating system is measured in millions of lines of code (for example, the latest versions of Linux contain more than 10,000,000 lines of code), the task of rewriting UNIX into another language becomes almost impossible (You should also take into account the fact that errors will inevitably occur during manual rewriting, which will significantly reduce the stability of the work, and code translation will suffer when translating using software). In addition, the C language, being close to the hardware implementation of the computer allows you to squeeze out of it much more than many other programming languages. This circumstance shows the senselessness of translating UNIX into another language. Thus, if other programming languages can disappear over time, giving way to new technologies, the C language will live as long as UNIX lives. That is, until there are computers in the form in which we imagine them.
The first book on the C language was written by Kernighan and Ritchie in 1978 and was published under the title "C programming language." This book, among programmers better known as K & R, has become the unofficial standard of the C language.
In the late 1970s, the C language began to crowd out BASIC, which at that time was the leader in the field of microcomputer programming. In the 1980s, it was adapted to the IBM PC architecture, which led to a significant jump in its popularity. At the same time, Bjarne Straustrup began developing a programming language that would combine the syntax of the popular C language and the concept of object-oriented programming, which was becoming more and more popular, so began the development of the C ++ language.
While C was gaining more and more popularity, compilers for him were produced by various firms, and often a program that was compiled on a compiler by one company was not compiled on another compiler. All this was due to the lack of a clearly defined standard of the C language. All developers focused on the book by Kernigan and Ritchie, but interpreted it in their own way.
The development of the C language standard was undertaken by the American National Standards Institute (ANSI). When it was in 1983, a committee X3J11 was formed, which was engaged in the development of the standard. The first version of the standard was released in 1989 and received the name C89. In 1990, making small changes to the standard, it was adopted by the International Organization for Standardization ISO. Then he became known under the ISO / IEC 9899: 1990 code, but the name associated with the year of adoption of the standard, C90, was fixed among the programmers. The latest version of the standard is ISO / IEC 9899: 1999, also known as C99, which was adopted in 2000.
Among the innovations of standard C99, one should pay attention to the change in the rule regarding the place of declaration of variables. Now new variables could be declared in the middle of the code, and not just at the beginning of the compound block or in the global scope. This leads C away from the concept of declaring variables at the beginning of a function that is present in Pascal. Like many programmers who are used to writing in C ++ (where this restriction is absent), this compiler behavior displeased me. However, even with the adoption of the C99 standard, in the Borland Embarcadeo RAD Studio 2010 program, the restriction on the declaration of variables at the beginning of the code block is still valid. You can also specify other places where C standards are not fully respected. It is believed that this is due to the fact that the focus of large companies such as Microsoft and Borland is focused on newer programming languages. However, according to the assurances of Sun Microsystems, its Sun Studio development environment fully supports C99.
The C99 standard is now more or less supported by all modern C compilers. Ideally, code written in C in compliance with standards and without the use of hardware- and system-dependent calls, became both hardware-and platform-independent code.
In 2007, work began on the following C standard: C1x.