high-level language
A high-level language (HLL) is a programming language such as C, FORTRAN, or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages.
In contrast, assembly languages are considered low-level because they are very close to machine languages.
Advantages of High-Level Languages
The main advantage of high-level languages over low-level languages is that they are easier to read, write, and maintain. Ultimately, programs written in a high-level language must be translated into machine language by a compiler or interpreter.
The first high-level programming languages were designed in the 1950s. Now there are dozens of different languages, including Ada, Algol, BASIC, COBOL, C, C++, FORTRAN, LISP, Pascal, and Prolog.
Machine Language
Machine Language is the language written as strings of binary 1`s and 0`s. It is the only language which a computer understands without using a translation program.
A machine language instruction has two parts. The first part is the operation code which tells the computer what function to perform and the second part is the operand which tells the computer where to find or store the data which is to be manipulated. A programmer needs to write numeric codes for the instruction and storage location of data.
Disadvantages –
- It is machine dependant i.e. it differs from computer to computer.
- It is difficult to program and write
- It is prone to errors
- It is difficult to modify
Assembly Language
It is a low level programming language that allows a user to write a program using alphanumeric mnemonic codes, instead of numeric codes for a set of instructions.
It requires a translator known as assembler to convert assembly language into machine language so that it can be understood by the computer. It is easier to remember and write than machine language.
Assembler – It is a computer program which converts or translates assembly language into machine language. It assembles the machine language program in the main memory of the computer and makes it ready for execution.
Advantages –
- It is easy to understand and use
- It is easy to locate and correct errors
- It is easier to modify
Disadvantages –
- It is machine dependant
High level Language
It is a machine independent language. It enables a user to write programs in a language which resembles English words and familiar mathematical symbols. COBOL was the first high level language developed for business.
Each statement in a high level language is a micro instruction which is translated into several machine language instructions.
A compiler is a translator program which translates a high level programming language into equivalent machine language programs. It compiles a set of machine language instructions for every high level language program.
Source code: It is the input or the programming instructor of a procedural language.
The compiler translates the source code into machine level language which is known as object code. Object code can be saved and executed as and when desired by the user.
Source Code → Language Translator Program → Object code
High level language → Machine level language
Linker: A program used with a compiler to provide links to the libraries needed for an executable program. It takes one or more object code generated by a compiler and combines them into a single executable program.
Interpreter: It is a translator used for translating high level language into the desired output. It takes one statement, translates it into machine language instructions and then immediately executes the result. Its output is the result of program execution.
Advantages of High level Language –
- It is machine independent
- It is easier to learn and use
- It is easier to maintain and gives few errors
Disadvantages –
- It lowers efficiency
- It is less flexible
No comments:
Post a Comment