History of C Language

Learn via video course
FREE
View all courses
C++ Course: Learn the Essentials
C++ Course: Learn the Essentials
by Prateek Narang
1000
5
Start Learning
C++ Course: Learn the Essentials
C++ Course: Learn the Essentials
by Prateek Narang
1000
5
Start Learning
Topics Covered

Overview:

Before learning anything, it is very necessary to know the history of what you are going to learn. The history of the C language is interesting to know. In the early 1970s, the C programming language was developed as a system implementation language for the emerging Unix operating system. It evolved a type structure from the typeless language BCPL; started on a small machine as a tool to better a minimal programming environment, it has become one of the most widely used languages today. In this article, we will discuss the history of the C language.

Introduction to C Programming Language:

The history of C-language is interesting to know. The C-language is a general-purpose and procedural-oriented programming language. It is a structured and machine-independent programming language. It was developed by Dennis Ritchie in 1972 at the AT&T Bell Laboratories. It was developed along with the UNIX operating system, and is strongly linked with UNIX operating system. History of C language revolves around development as a system implementation language to write an operating system. In terms of the history of C language, its main features include low-level memory access as well as high-level memory access (so it is a middle-level programming language), a handy set of keywords, and a neat and clean style, these features make C programming language suitable for system programming. C supports a wide variety of built-in functions, standard libraries and header files. It follows a top-down approach. Many languages have derived syntax directly or indirectly from the C programming language. For example, C++ is closely a superset of the C language. Also, C programming language is very popular for system-level apps.

History of C Programming Language:

To learn about the history of C language, let's first start with its root and early developments. The root of all modern languages is ALGOL (Algorithmic Language). ALGOL was the first computer programming language to use a block structure, and it was introduced in 1960. In 1967, Martin Richards developed a language called BCPL (Basic Combined Programming Language). BCPL was derived from ALGOL. In 1970, Ken Thompson created a language using BCPL called B. Both BCPL and B programming languages were typeless. After that, C was developed using BCPL and B by Dennis Ritchie at the Bell lab in 1972. So, in terms of history of C language, it was used in mainly academic environments, but at long last with the release of many C compilers for commercial use and the increasing popularity of UNIX, it began to gain extensive support among professionals.

chronological-history-of-c

Early Implementations and Language Standard:

As discussed, in the history of C language, the development of C was intended to serve as the foundation for the creation of UNIX. By early 1973, the rudiments of ultramodern C had been completed, according to the Bell Labs report. The language and compiler were both powerful enough to rewrite the UNIX kernel in C for the PDP-11. Brian Kernighan and Dennis Ritchie published The C Programming Language in 1978, which served as a reference for the language until a formal standard was established in the history of C language. Between 1973 and 1980, the language evolved slightly: unsigned, long, union, and enumeration types were added to the type structure, and structures became practically first-class objects (lacking only a notation for literals). Its environment, as well as the technology that accompanied it, saw significant changes. In the summer of 1983, American National Standard Institute (ANSI) formed the X3J11 committee under the guidance of CBEMA with the purpose of establishing a C standard. At the end of 1989, X3J11 published its report [ANSI 89], which was later recognised by ISO as ISO/IEC 9899-1990.

A List of Programming Languages Developed Before C Language:

LanguageYear of DevelopmentDeveloper
ALGOL1960International Group
BCPL1967Martin Richards
B1970Ken Thompson
Traditional C1972Dennis Ritchie
K&R C1978Kernighan and Ritchie
ANSI C1989ANSI Committee
ANSI/ISO C1990ISO Committee
C991999Standardization Committee

The Problems of B Programming Language:

The B programming language has a different importance in the history of C language. As its shortcomings made C a more robust language. The BCPL and B languages were employed on word-addressed machines, and the sole data type in these languages, the 'cell,' was easily equated with the hardware machine word. The introduction of the PDP-11 uncovered various flaws in B's semantic model. First, its character-handling techniques, which were inherited from BCPL with few changes, were cumbersome. Second, by specifying special operators, floating-point operations were introduced to BCPL in Multics and GCOS compilers, but the process was only conceivable because a single word on the relevant machines was large enough to represent a floating-point integer; this was not the case on the 16-bit PDP-11. Finally, the B and BCPL models implied overhead when dealing with pointers: the language rules caused pointers to be represented as word indices by defining a pointer as an index in an array of words. A run-time scale conversion from the pointer to the byte address anticipated by the hardware was generated for each pointer reference.

Standardization of C:

In 1983, ANSI formed the X3J11 committee to standardise the C programming language. The Accredited Standards Committee X3 (ASC X3), Information Technology, was in charge of this endeavour, which led in ANSI X3.159-1989: Programming Language C being ratified on December 14, 1989 and published in the spring of 1990. With some new additions, this original standard unified existing practises. The standard stated in the ANSI X3.159-1989 document was known as ANSI C at the time in the history of C language, however it was quickly superseded when ISO/IEC 9899:1990 was established as an international standard, thanks to the efforts of ISO/IEC JTC 1. While this is where the name ISO C came from, the national and international standards are now known as C89 and C90, respectively.There have been several updates and corrigenda produced in the years since the ISO/IEC 9899 international standard was established. The current C programming language is defined by ISO/IEC 9899:2018 – Information technology – Programming languages – C, the fourth edition of the standard. C11 is the informal term given to the C language established by the 2011 edition of the standard. While neither this, nor the titles ANSI C and ISO C are ever expressly referenced in the standard text, their occasional usage underscores the significance of the hard work carried out by the standards community over the previous thirty years in unifying this programming language.

How does C Programming Language Work?

Execution of the C program involves 5 steps. These are:

  1. Creating the Program
  2. Preprocessing
  3. Compiling the Program
  4. Linking the Program with functions from the C library
  5. Executing the Program

working-of-c

  1. Creating the Program: Firstly, we need to create a C program. For that, we will open a text editor and write our C program into it. Then save the file with .c extension. For example: hello.c The program written into the file is known as the source code, and it serves the original form of the C program.

  2. Preprocessing: Preprocessing is the stage where source code is passed for the first time. This stage consists of the following steps:

  • Expansion of Macros and Comment Removal
  • Expansion of the included files
  • Conditional compilation The preprocessed output of hello.c is stored in the file hello.i.
  1. Compiling the Program: Once our source code is preprocessed in the file hello.i. Now our file is ready for compilation, which after compilation produces an intermediate compiled output file hello.s, which is in assembly level instructions. During the compilation process, the compiler checks for all the compilation errors. If the online C compiler gives no error, then the hello.s is taken as input and turned into hello.o by the assembler in the next phase. This file contains machine-level instructions. At this phase, only existing code is converted into machine language, and the function calls are not resolved. Since the object file is not executable, the process is transferred to the linker, which ultimately produces a .exe file.

  2. Linking the Program with functions from the C library: This is the final phase, in which all of the function calls are linked to their definitions. Linker knows where all these functions are implemented.  The linker performs additional work and adds more code to our programme that is required when it starts and stops. Setting up the environment, for example, requires a code, as does sending command-line inputs. The linker connects the object code of our programme file to the C library functions, resulting in an.exe file, hello.exe, which is an executable file, will be created here.

  3. Executing the Program: The execution of a program is a very simple task. After giving the command to execute a particular program. The loader will load the executable object code into the RAM and execute the instructions.

C Basic Commands:

Some basic commands are required to write a C programme. But, before we get into the basic C commands, let's have a look at a simple C program.

Output:

Below are a few basic commands of C.

S. No.C Basic CommandsNameWhat it does (Explanation)
1#includePreprocessor directiveUsed to include header files.
2<stdio.h>header fileThe stdio.h header defines three variable types, several macros, and a variety of input and output functions.
3main()main functionThe execution of code begins from main function.
4{opening curly braceIt indicates the start of a function.
5printf()printing functionUsed to display output on the screen.
6;semicolonMarks the end of the statement.
7return 0;return 0This command shows the exit status of a function.
8}closing curly braceIt indicates the end of a function.
CompilerSupporting CompilerDirect Link
Scaler Topics Online C CompilerGCC CompilerTry Scaler Topics Online C Compiler
OnlineGDB Online C CompilerGCC CompilerTry GDB Online C Compiler
CodeChef Online C CompilerGNU compilerTry CodeChef Online C Compiler
TutorialsPoint Online C CompilerGNU GCC v7.1.1Try TutorialsPoint Online C Compiler
Ideone Online C CompilerTurbo C compilerTry Ideone Online C Compiler

Clang Compiler:

Clang is a "LLVM native" C/C++/Objective-C compiler that strives to give lightning-fast compiles, incredibly informative error and warning messages, and a foundation for developing excellent source-level tools. It is a language front-end and tooling infrastructure for the LLVM project for languages in the C language family (C, C++, Objective C/C++, OpenCL, CUDA, and RenderScript). There is a GCC-compatible compiler driver (clang) as well as an MSVC-compatible compiler driver (clang-cl.exe). The Clang Static Analyzer and clang-tidy are examples of the kinds of tools that can be constructed utilising the Clang frontend as a library to parse C/C++ code.

MinGW Compiler (Minimalist GNU for Windows):

MinGW means Minimalist GNU for Windows: GNU is a source of open source programming tools. MinGW, formerly mingw32, is a free and open-source software development environment to create Microsoft Windows applications. It is a derivative of the original mingw.org project, which was intended to help Windows users use the GCC compiler. The majority of languages supported by GCC are also supported by the MinGW version. C, C++, Objective-C, Objective-C++, Fortran, and Ada are among them. GCC runtime libraries (libstdc++ for C++, libgfortran for Fortran, and so on) are used.

Portable C Compiler:

The compiler is based on Stephen C. Johnson's initial Portable C Compiler from the late 1970s. Despite the fact that much of the compiler has been redone, some of the fundamentals have not changed. PCC appeared in Unix Version 7, and in System V and BSD 4.x versions, it replaced the DMR compiler (Dennis Ritchie's initial C compiler). The portability and increased diagnostic capabilities of pcc were fundamental to its success. Only a few of the compiler's source files were designed to be machine-dependent. It was more resistant to syntax errors than its contemporaries and performed more rigorous validity checks. Dennis Ritchie's initial C compiler used a recursive descent parser, included PDP-11-specific knowledge, and depended on an optional machine-specific optimizer to improve the assembly language code it created. Johnson's pccm, on the other hand, was built using a yacc-generated parser and a more broad target machine model. Both compilers generated target-specific assembly language code, which was compiled into linkable object modules.

Turbo C:

Turbo C is an IDE and compiler for the C programming language. It was launched in 1987. It is a free and open-source compiler for C and C++. It was the most popular IDE and compiler because of its small size, fast compilation speed, and, comprehensive manuals. In May 1990, Borland replaced Turbo C with Turbo C++. In 2006, Borland reintroduced the Turbo moniker.

Successors of C

Concurrent C:

Concurrent C is a programming language. It was developed in 1989. It is a superset of C that includes parallel programming features such as declaring and creating processes, synchronising and interacting with processes, and terminating and aborting processes. Concurrent C was created to make the best use of multiprocessors and multicomputers. Concurrent C also works with C++, an object-oriented superset of C, as a compile-time option.

Objective C:

Smalltalk-style messaging is added to the C programming language in Objective-C, making it a general-purpose, object-oriented programming language. Apple's main programming language for the OS X and iOS operating systems, as well as their associated APIs, Cocoa and Cocoa Touch, is Objective-C. It's an object-oriented superset of the C programming language with a dynamic runtime. The syntax, primitive types, and flow control instructions of C are all carried over to Objective-C, along with syntax for constructing classes and functions. It also includes support for object graph management and object literals at the language level, as well as dynamic type and binding, deferring many responsibilities until runtime.

C#:

The symbol C# is pronounced "C-Sharp." It's a Microsoft-developed object-oriented programming language that runs on the .NET Framework. C# is related to other popular languages such as C++ and Java, and it has roots in the C family. In the year 2002, the first version was released. C# 8, the most recent version, was published in September of this year. Although C# constructs closely follow classic high-level languages, C and C++ and being an object-oriented programming language. It has a lot in common with Java, and it has a lot of powerful programming capabilities that make it appealing to a lot of programmers all over the world. Following is the list of few important features of C# −

  • Boolean Conditions
  • Automatic Garbage Collection
  • Standard Library
  • Assembly Versioning
  • Properties and Events
  • Delegates and Events Management
  • Easy-to-use Generics
  • Indexers
  • Conditional Compilation
  • Simple Multithreading
  • LINQ and Lambda Expressions
  • Integration with Windows

C++:

The C++ programming language is an object-oriented programming language. It was created by Bjarne Stroustrup at Bell Laboratories in 1980. The idea of C++ comes from the C increment operator ++, so it can be said that C++ is an incremented version of C and it is a superset of C. Classes, inheritance, function overloading, and operator overloading are the most essential features that C++ adds to C. C++'s object-oriented capabilities enable us to create massive, sophisticated programmes that are clear, affable, and easy to maintain. C++ is one of the most widely used programming languages in the world. Today's operating systems, graphical user interfaces, and embedded systems all contain it. It's an object-oriented programming language that offers programmes a logical framework and allows code to be reused, reducing development expenses. It is portable and can be used to create apps that are cross-platform compatible.

Why Should You Learn C?

C programming language is a middle-level programming language that means it provides both high-level (user-friendly) and low-level (machine understandable) features. So it can be used for writing application-level programming as well as operating systems. It supports pre-build libraries so that users can implement basic operations without any difficulty. C is broadly used in Embedded Programming. One of most popular thing about C is that it is a very fast programming language in terms of execution time. Similarly, there are many more advantages of learning C.

Applications of C Programming:

  • C can be used to design browsers.
  • As mentioned earlier C is strongly linked with UNIX Operating System. So, C can be used to design an operating System.
  • C language can be used to develop smartphone games as well.
  • Worthwile to mention, C can be used to design a database. Many of the databases are based on C like Oracle, PostgreSQL, MySQL, MS SQL Server.

Conclusion:

  • We can use the C programming language in wide areas of programming and development.
  • The development of C was intended to serve as the foundation for the creation of UNIX.
  • In 1983, ANSI formed the X3J11 committee to standardise the C programming language.
  • Development of C language opened dimensions for improvement in several existing languages. Also, it became foundation for several new programming languages.