Computer Based Languages
The user of a computer must be able to communicate with it. That means, he must be able to give the computer commands and understand the output that the computer generates. This is possible due to the invention of computer languages.Basically, there are two main categories of computer languages, namely Low Level Language and High Level Language. Let us take a brief look at both these types of computer languages.
1: Low Level Language
Low level languages are the basic computer instructions or better known as machine codes. A computer cannot understand any instruction given to it by the user in English or any other high level language. These low level languages are very easily understandable by the machine.The main function of low level languages is to interact with the hardware of the computer. They help in operating, syncing and managing all the hardware and system components of the
computer. They handle all the instructions which form the architecture of the hardware systems.
Machine Language
This is one of the most basic low level languages. The language was first developed to interact with the first generation computers. It is written in binary code or machine code, which means itbasically comprises of only two digits –1 and 0.
Aseembly Language
This is the second generation programming language. It is a development on the machine language, where instead of using only numbers, we use English words, names, and symbols. It is the most basic computer language necessary for any processor.
2: High Level Languages
When we talk about high level languages, these are programming languages. Some prominent examples are PASCAL, FORTRAN, C++ etc.The important feature about such high level languages is that they allow the programmer to write programs for all types of computers and systems. Every instruction in high level language is converted to machine language for the computer to comprehend.
Scripting Language
Scripting languages or scripts are essentially programming languages. These languages employ a high level construct which allows it to interpret and execute one command at a time.Scripting languages are easier to learn and execute than compiled languages. Some examples are AppleScript, JavaScript, Pearl etc.
Object-Orinted Language
These are high level languages that focus on the ‘objects’ rather than the ‘actions’. To accomplish this, the focus will be on data than logic.The reasoning behind is that the programmers really cares about the object they wish to manipulate rather than the logic needed to manipulate them. Some examples include Java, C+, C++, Python, Swift etc.
Procedural Programmig Language
This is a type of programming language that has well structured steps and complex procedures within its programming to compose a complete program.It has a systematic order functions and commands to complete a task or a program. FORTRAN, ALGOL, BASIC, COBOL are some examples.
C Language Introduction
The main features of C language include low-level access to memory, a simple set of keywords, and clean style, these features make C language suitable for system programminglike an operating system or compiler development. Many later languages have borrowed syntax/features directly or indirectly from C language. Like syntax of Java, PHP, JavaScript, and many other languages are mainly based on C language.
C++ is nearly a superset of C language (There are few programs that may compile in C, but not in C++).
C is a general-purpose programming language that is extremely popular, simple and flexible. It is machine-independent, structured programming language which is used extensively in various applications. C was the basic language to write everything from operating systems (Windows and many others) to complex programs like the Oracle database, Git, Python interpreter and more.
It is said that 'C' is a god's programming language. One can say, C is a base for the programming. If you know 'C,' you can easily graspthe knowledge of the other programming languages that uses the concept of 'C'. It is essential to have a background in computer memory mechanisms because it is an important aspect when dealing with the C programming language.
History of C Language
C programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T (American Telephone & Telegraph), located in the U.S.A.
Dennis Ritchie is known as the founder of the C language.
- C programming language is a structure oriented programming language, was developed at Bell Laboratories in 1972 by Dennis Ritchie
- C language features were derived from earlier language called “B” (Basic Combined Programming Language –BCPL)
- In earlier days, programs were written in assembly level language. So, it had happened to write very big programs to perform specific tasks using assembly code.
-‘B’ language could perform the same task in few lines of program and it was faster than assemble language code.
- B language did not support some features like data types and structures etc. So, this was a drawback of B language. So, Dennis Ritchie developed C language by keeping most part of the B language and adding many features thatproduced powerful and effective outputs.
- C language was invented for implementing UNIX operating system. Most of the UNIX components were rewritten in C.
- In 1978, Dennis Ritchie and Brian Kernighan published the first edition“The C Programming Language” and commonly known as K&R C
- In 1983, the American National Standards Institute (ANSI) established a committee to provide a modern, comprehensive definition of C. The resulting definition, the ANSI standard, or “ANSI C”, was completed late 1988.
- C89/C90 standard –First standardized specification for C language was developed by American National Standards Institute in 1989. C89 and C90 standards refer to the same programming language.
- C99 standard –Next revision was published in 1999 that introduced new futures like advanced data types and other changes
- C11 standard adds new features to C and library like type generic macros, anonymous structures, improved Unicode support, atomic operations, multi-threading, and bounds-checked functions. It also makes some portions ofthe existing C99 library optional, and improves compatibility with C++.
- Embedded C includes features not available in normal C like fixed-point arithmetic, named address spaces, and basic I/O hardware addressing
Uses of C programming language
- Creating Computer Applications
- It is used in writing embedded software
- Various Electronics, industrial and communications products which use microcontrollers.
- It is also used in developing test code, verification software, etc. for various application and hardware products.
- C is used in creating compilers of different languages which can take input from other languages and convert it into lower level machine dependent languages.
- C is designed for system level and embedded software development.
- Mainly C Language is used for Develop Desktop application and system software. Some application of C language isgiven below.
- C programming language can be used to design the system software like operating system and Compiler.
- To develop application software like database and spread sheets.
- For Develop Graphical related application like computer and mobile games.
- To evaluate any kind of mathematical equation use c language.
- C programming language can be used to design the compilers.
- UNIX Kernal is completely developed in C Language.
- For Creating Compilersof different Languages which can take input from other language and convert it into lower level machine dependent language.•
- C programming language can be used to design Operating System.
- C programming language can be used to design Network Devices.
- To design GUI Applications. Adobe Photoshop, one of the most popularly used photo editors since olden times, was created with the help of C
What does compiler mean?
Compilers convert instructions written in a programming language to machine code that can be read by computers. If you're interested in learning to program in C or C++, you'll find this list of free compilers handy.
Microsoft Windows SDK.
This free SDK is for Windows 7 and .NET Framework 4. It provides compilers, tools libraries, code samplesand a help system for developers.
Turbo C++
For Windows 7,8,8.1 and 10. The .NET Framework is required for Windows 7, Vista and XP, but there is no pre-requirement for more recent Windows versions.
GCC
Is the classic open source C compiler for Linux and many other operating systems (including Windows under Cygwin or Ming). This project has been around forever and provides excellent open source quality software. It doesn't come with an IDE, but there are loads out there.
Digital Mars C/C++ Compiler.
The company offers several free compiler packages
Xcode
Is for Apple's Mac OSX operating system and its version of GCC. It has excellent documentation and SDKsfor Mac and iPhone. If you have a Mac, this is what youuse.
Portable C Compiler.
This was developed from one of the earliest C Compilers. At the start of the '80s, most C compilers were based on it. Portability was designed into it from the start.
Failsafe C.
A Japanese project from the Research Team for Software Security at the Research Center for Information Security, National Institute of Advanced Industrial Science and Technology, Japan, this version of C for Linux supports over 500 functions (not C99 or Widechar). It provides complete protection against memory block over-boundary accesses making it as safe as Java and C#
Pelles C
Is a free development kit for Windows and Windows Mobile containing an optimizing C compiler, a macro assembler, a linker, a resource compiler, a message compiler, a make utility and installs builders for both Windows and Windows Mobile. It also has an IDE with project management, debugger, source code editor and resource editors for dialogs, menus, string tables, accelerator tables, bitmaps, icons, cursors, animated cursors, animationvideos, versions, and XP manifests.
Borland C++ 5.5
Compiler is a blazingly fast 32-bit optimizing compiler. It includes the latest ANSI/ISO C++ language support including the Standard Template Library framework and C++ template support and the complete Borland C/C++ Runtime Library. Also included in the free download are the Borland C/C++ command line tools such as the high-performance Borland linker and resource compiler.
nesC
Is an extension to the C programming language designed to embody the structuring concepts and execution model of TinyOS.
TinyOS
Is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM).
Orange C
Orange C/C++ supports C standards through C11 and C++ 11. The IDE is full-featured and includes a colorizing editor. This compiler runs on WIN32 and DOS. It generates 32-bit programs for both.
SubC
Is a fast, simple public domain compiler for a clean subset of the C programming language on Linux, FreeBSD and Windows platforms.
Below are the top compilers of C
- Borland Turbo C. Turbo Cis one of the basic and popular compilersfor the Cprogramming language. ...
- Tiny C Compiler. The Tiny C Compileris designed to work on slow computers with little disk space. ...
- Portable C Compiler. ...
- GCC. ...
- Clang.
Borland Turbo C
Turbo Cis one of the basic and popular compilers for the C programming language. This was first introduced in 1987; it was popular for its small size, compilation speed, and low price. Once Turbo C++ got released in 1990, both the compilers are merged and the name Turbo C got discontinued. In 2006, Embarcadero Technologies had re-released Turbo C asfreeware. Do you remember this blue screen?
Tiny C Compiler
TheTiny C Compileris designed to work on slow computers with little disk space. This is an ARM processor C compiler. This compiler started its support to Windows from 2005. Some of its features are mentioned below
- Its file size is small and according to the owner of this compiler (Fabrice Bellard). The fastness of this compiler is around nine times faster than GCC. The compilation, assembling and linking of code were the main attributes considered for measuring the fastness of this compiler.
- This compiler had included many compiler-specific features to boost up the optional memory, bound checker and had greater code stability.
- This compiler allows automatic execution of programs during the compile-time only using command line arguments. This way, programs are executed under UNIX, using shell scripts. The latest version was released on December 2017.
Portable C Compiler
ThePortable C Compiler(PCC) was a very early used and establishedcompilerfor theC programming language that is almost around mid-1970. This compiler had a long life span. This was prevalent during a period in such a way that many of the C compilers were based on it. The advantages of PCC depended on its capabilities and probability predictions. PCC compilerwas made such that source files were machine-dependent, not all but only a few of them. It can detect syntax errorsand can perform perfect validity checks. A new version of PCC was released on 10 December 2014.
GCC
GNU Compiler Collection is the compiler produced by the GNU Project. This supports many programming languages and it is a free software foundation under the General Public License. This compiler was first released in 1987 and it supported only C-Programming language during the start. Slowly it expanded to C++, Java, Android, and IOS. Here, each of the different language compilers has its own program that readsthe code written and sends the machine code as the output. All of these have a common internal structure. When a high-level language is written, as per the language it is written, the compiler parses the code in that language and produces an abstract syntax tree. GCC uses LALR parsers, but slowly switched to recursive-descent parsers for C in 2006. Coming to the optimization part, as already known this can occur during any phase of the compilation. However, here the bulk optimizations are performed before the code generation and after the syntax, semantic analysis. Below are a few of the optimizations performed by GCC.
- It can eliminate the Dead Code pieces.
- It can eliminate the redundancy at the code level.
- Replacement of Aggregates with respect to the scalar level.
- Can perform optimizations with Arrays.
In GCC back end is specified by preprocessor macros and functions specific to a particular architecture. This code is generally built by first calling a small snippet code which is associated with each pattern and generate instructions from the instruction set. It is done using registers, offsets, and addresses that are chosen during the re-load phase. The current version of GCC is 9.2, which was released on August 12, 2019.
Clang
- Clang; including C, is also a compiler for C++, Objective-C, and objective-C++ programming languages. This compiler uses LLVM for the back end code related compilations. This compiler has been designed to act as a replacement for the GCC by supporting many of its compilation flagsand language extensions.
- Clang has many contributors includingApple, Microsoft, Google, Sony, and Intel. It is open-source software. LLVM was first used by GCC for the front end compilation, but GCC had caused some problems for developers at Apple, as the source code is large and difficult to use. So, they had come up with Clang.
- One of the major goals for Clang is to provide library-based architecture. It is designed to keep more information during the compilation process than GCC. This also helps to preserve the overall shape of the original code
- The error report generated by Clang during compilation is always in a detailed and specific in a machine-readable format. Clang had always aimed to reduce the over usage of memory space and increase the compilation speed as compared with GCC, and due to these qualities, it had become one of the fastest-growing used compilers during a point of time. But over a period the performance of Clang started to come down. The reports
told the performance had lagged with almost large differences as compared with GCC and started to have slower performance. The most recent comparisons indicate that both the compilers had come up and increased their performance and once again creating great competition between them. Yet, GCC remains to top the list.
Interpreter
In computer science, an interpreteris a computer programthat directly executesinstructions written in a programmingor scripting language, without requiring them previously to have been compiledinto a machine languageprogram. An interpreter generally uses one of the following strategies for program execution:
- Parsethe source codeand perform its behavior directly;
- Translatesource code into some efficient intermediate representationand immediately execute this;
- Explicitly execute stored precompiled code[1]made by a compilerwhich is part of the interpreter system.
A high-level language is one that is understandable by us, humans. This is called source code. However, a computer does not understand high-level language. It only understands the program written in 0's and 1's in binary, called the machine code
To convert source code into machine code, we use either a compileror an interpreter. Both compilers and interpreters are used to convert a program written in a high-level language into machine code understood by computers. However, there are differences between how an interpreter anda compiler works
Why learn C programming?
Learning C has a similar benefit. If the person had learned driving on a manual car, he could have easily driven the automatic car as well. Similarly, if a person learns C programming first, it will help him to learn any modern programming language as well. As learning C help to understand a lot of underlying architecture of operating system. Like, pointers, working with memory locationsetc
Let us now look at some of the important advantages of learning C programming
C is a Middle-Level Language.
The middle-level languages are somewhere between the Low-levelmachine understandable assembly languages and High-Leveluser friendly languages. Being a middle-level language, C reduces the gap between the low-level and
high-level languages. It can be used for writing operating systems as well as doing application level programming.
Helps to understand the fundamentals of Computer Theories.
Most of the theories related to computers like Computer Networks, Compiler Designing, Computer Architecture, Operating Systemsare based on C programming language and requires a good knowledge of C programming if you are working on them. In the modern high level languages, the machine level details are hidden from the user, so in order to work with CPU cache, memory, network adapters, learning C programming is a must.
Fewer Libraries.
C programming language has fewer libraries in comparison with other high-level languages. So, learning C programming also clears programming concepts to a great extent as you have to write lot of things from scratch. You will not be dependent on the programming language entirely for implementing some basic operations and implementing them on your own will also help you to build your analytical skills.
C is very fast in terms of execution time.
Programs written and compiled in C executes much faster than compared to any other programming language. C programming language is very fast in terms of execution as it does not have any additional processing overheads such as garbage collection or preventing memory leaks etc. The programmer must take care of these things on his own.
Embedded Programming.
C is extensively used in Embedded Programming. Embedded Programming is also referred to as micro-controller programming, where C program is used to control micro-controllers. Microcontrollers and embedded programming is widely used in auto-motives, Robotics, Hardware'setc.
|