The term computer language is an alternate name for the more commonly used term, programming language. Programming languages are a part of computer languages. A program is written in a specific language that a computer can understand and interpret. The language is called the computer language or programming language. The person writing a program is called a programmer. The programmer must follow the syntax and the semantics of the programming language to write a program.
Some of the most commonly used programming languages are C, C++, Java, PASCAL, C#.net, Visual Basic, etc.
Types of computer programming languages
1) Low-Level Languages or Machine-Level Languages
A computer is an electronic machine, which can understand any instruction given to it in the coded form. The languages that a computer understands directly consist of codes in the form of zeros and ones (0s and 1s) and they are termed as machine language. Ex= 1011111 1110101 ……..
- Computers can understand machine code without any conversion. Hence, the processing is very fast.
- Machine languages make efficient use of storage (instructions and their storage in computer memory can be easily controlled).
- Machine language instructions can be used to manipulate the individual bits in a byte of computer storage.
- These languages are architecture-dependent.
- It is difficult to remember the codes.
- It is difficult to correct or modify machine language programs. Checking the machine instructions to locate errors is as tedious as writing them from the origin.
2) Assembly-level language or middle-level language
- The drawback of machine language leads to the introduction of a new programming language called the assembly language.
- Assembly level language uses mnemonic code.
- The language substitutes letters and symbols (mnemonics) for the numbers in the machine program.
- Assembly language is also called symbolic language. A program written in a symbolic language is called an assembly code or a symbolic program.
- Ex: ADD A is the symbolic operation code to represent addition and SUB B for subtraction. Here, ADD A and SUB B represent the mnemonic code.
- Assembly level language is very flexible and powerful.
- It is faster in comparison to the high-level languages
- Needs a translator to convert this to machine language for the machine to understand
- This language is architecture-dependent. This means that the program written for one compiler cannot run on another one.
- Coding takes a lot of time as the language is complex by nature.
3) High-level languages
- To overcome the difficulties of machine and assembly level languages such as architecture dependency, difficult to understand, etc. high-level programming languages were developed.
- High-level languages are closer to English languages and hence the name high-level language.
High-level languages are classified into two types:
1)General-purpose language: They can be used to solve a wide variety of problems such as business problems, scientific problems, and graphical applications and so on. Ex= C, C++, Java, etc.
2) Specific-purpose languages: They can be used to solve only certain kinds of problems. Ex= COBOL and FORTRAN
- A program written in a high-level language is easy to understand and written because it is closer to the English language.
- It is machine-independent.
- As the programs are written in high-level language take more time to run and require more main storage, they prove to be less efficient in the use of the CPU and other facilities.
- A source of a program written in this language needs a compiler translator, which is loaded into the main memory of the computer. This occupies much of the memory space. The memory available for a source program is greatly reduced.
Languages Processors in computer programming
Nowadays, programming is carried out in high-level languages like C, C++, etc. In order to convert high-level language programs to machine-level language, language processors are used.
Type of language processors
- It is a program translator that translates the instruction of a high-level language to machine language. It reads the entire program first and then translates it into machine code.
- The program written by the programmer in a high-level language is called a source program or source code. When this program is converted to machine language by the compiler it is called an object program.
- A compiler can translate only those source programs, which are written, in a particular language for which the compiler is meant for. For example, the COBOL compiler will not compile source code written in C language.
- The object program generated by the compiler is machine-dependent. That means programs compiled for one type of machine will not run in another type. Therefore, every type of machine must have its own type of personal compiler for a particular language. Machine independence is achieved by using high-level language in different machines.
- Languages that use a compiler like C and PASCAL etc.
- An interpreter is also a program translator used for translating the high-level language into the machine language. But it takes one statement of a high-level language, translates it into machine language and then executes it immediately. Translation and execution are carried out for each statement. BASIC and LISP languages are interpreter based.
- The advantage of an interpreter when compared to the compiler is its fast response to changes in the source programs. It eliminates the need for a separate compilation after the changes made to a program.
- Interpreter programs are easy to write and occupy less space in memory.
- The disadvantage of the interpreter is that translation takes place for every line of source code. Hence it is time-consuming. Thus, the compiled machine language program runs much faster than an interpreted program.
- Also, an interpreter has no memory to store the translated lines. Every time a program is executed, the source code has to be converted afresh.
- Some of the computer high-level programming languages that use an interpreter are BASIC, COBOL, PERL, ASP, etc.
- An assembler is a computer program for translating an assembly language, essentially, a mnemonic representation into object code or the machine code.
- Assembler is only used by assembly-level languages.
- Some assemblers are MASM (macro assembler), TASM (turbo assembler) etc.
Note: Java language has both the compiler and interpreter. The source code is first converted to a byte code by a compiler and then a byte code is interpreted to generate a machine-independent executable code.
Some concept of programming languages
- Modular programming refers to a technique in which the logical parts of a problem are divided into a series of individual routines so that each may be programmed independently.
- Procedural programming refers to functions and the execution of the functions. It emphasizes more on procedure than the data.
- Programming the code that executes in response to an event is called event-driven programming.
- Events are the actions or notifications that are used to initiate code execution. In visual basic, the programmer has the ability to create a graphical user interface (GUI) by pointing and clicking with the mouse. The programmer creates the GUI and writes code to describe what happens when the user intersects (clicks, load, double-click, etc.) with the GUI.
- For example= Visual Basic.
- In object-oriented programming, a program is no longer a series of instructions, but a collection of objects these objects contain both data and instructions that are assigned to classes and can perform specific tasks.
- With this approach, programmers can build programs from pre-existing objects and can use features from one program in another. These results in faster development time reduced maintenance costs and improved flexibility for future revisions.
- Some examples of object-oriented languages are C++, Java, and Ada.
- The process of rapidly creating an application is typically referred to as Rapid Application Development. Visual Basic is the world’s most widely used RAD language in past years.
Comment your review of computer programming languages and know about the history of computers.