Computer programming language, any of various languages for expressing a set of detailed instructions for a digital computer. Such instructions can be executed directly when they are in the computer manufacturer-specific numerical form known as machine language, after a simple substitution process when expressed in a corresponding assembly language, or after translation from some “higher-level” language. Although there are over 2,000 computer languages, relatively few are widely used.
- Machine
language
Machine code or machine language is a system of
impartible instructions executed directly by a computer's central processing unit. Each instruction performs
a very specific task, typically either an operation on a unit of data (in a
register or in memory, e.g. add or move), or a jump operation (deciding which
instruction executes next, often conditional on the results of a previous
instruction). Every executable program is made up of a series of these atomic
instructions. Machine code may be regarded as a primitive (and cumbersome) programming language or as the lowest-level
representation of a compiled
and/or assembled computer
programme.
While it is possible to write programs in machine code, because of the tedious
difficulty in managing CPU resources, it is rarely done any more, except for
situations that require the most extreme optimization. This language is used in
the first generation computers and when we writing programmes in machine language
we have to use binary digits (0, 1).
Almost all executable programmes are written in higher level languages,
and translated to executable machine code by a compiler and linker. Machine code is sometimes called native code when referring to platform-dependent parts of language
features or libraries.
Programmes in interpreted languages are not represented by machine code,
however, their interpreter
(which may be seen as a processor executing the higher level programme) often is.
Machine code should not be confused with so called "bytecode",
which is executed by an interpreter.
-
High level languages
A high-level programming
language is a programming language with strong abstraction from the details of the computer. In comparison to low-level programming languages, it
may use natural language elements, be easier to use, or be from the specification of
the programme, making the process of developing a programme simpler and more
understandable with respect to a low-level language. The amount of abstraction
provided defines how "high-level" a programming language is. Also
this is a programming
language
such as C, Ada, Algol, BASIC, COBOL, C, C++,
FORTRAN, LISP,
Pascal, Prolog, or FORTRAN that
enables a programmer to
write programmes 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.
The first high-level programming language to be designed for a computer
was Plankalkul,
created by Konrad
Zuse.
However, it was not implemented in his time and his original contributions were
isolated from other developments.
- Low
level languages
In computer science, a low-level
programming language is a programming language that provides little or no
abstraction from a computer's instruction set architecture.
Generally this refers to either machine
code
or assembly language. The word "low" refers to the small or
nonexistent amount of abstraction between the language and machine language; because of this,
low-level languages are sometimes described as being "close to the
hardware."
Low-level languages can be
converted to machine code without using a compiler or interpreter, and the
resulting code runs directly on the processor. A programme written in a low-level
language can be made to run very fast, and with a very small memory footprint;
an equivalent programme in a high-level language will be more heavyweight.
Low-level languages are simple, but are considered difficult to use, due to the
numerous technical details which must be remembered.
- Language
translators
A computer can only
understand programmes defined using machine code. Consequently a programme written
for example in a high level language such as Java cannot be run directly. To
execute a computer programme written in high or low level language, it must be
first being translated.
There are 3 types of
system software used for translating the code that a Programmer writes into a
form that the computer can execute (i.e. machine code). These are:
1. Assemblers
2. Compilers
3. Interpreters
Source Code is the code that is input
to a translator.
Executable code is the code that is output
from the translator.
Assembler
Assembler is a computer programme to
translate between lower-level representations of computer programmes. An
assembler converts basic computer instructions into a pattern of bits which can
be easily understood by the computer and the processor can use it to perform
its basic operation. An Assembler converts an assembly program into machine code.
Compiler
A compiler is a computer programme (or set of programs) that transforms source code written in a programming language(the source language) into another
computer language (the target language, often having a
binary form known as object code). The most common reason for wanting to transform source code is to
create an executable programme. Compiler converts source code to executable code line by line.
The name
"compiler" is primarily used for programmes that translate source code
from a language to a lower level
language (e.g., assembly language or machine code). If the compiled
programme can run on a computer whose CPU or operating system is different from the one on which the compiler runs, the compiler is
known as a cross-compiler. A programme that
translates from a low level language to a higher level one is a decompiler. A programme that translates between high-level languages is usually
called a language translator, source
to source translator, or language converter. A language rewriter is usually a
programme that translates the form of expressions without a change of language.
Interpreter
Interpreter is a program that executes instructions written in a high-level language.
There are two ways to run programmes
written in a high-level language. The most common is to compile the programme; the other method is to pass the
programme through an interpreter.
When we converting a
computer programme to machine language by using interpreter it converts the
programme to machine language line by line.