0% found this document useful (0 votes)
53 views

Programming Languages

A programming language allows humans to communicate instructions to computers. There are two main types: low-level languages like machine code and assembly language, which are close to what computers actually understand; and high-level languages like C++ and Python, which are easier for humans to read and write but must be translated into machine code. Programs written in high-level languages are translated by compilers or interpreters so the computer can understand and execute the instructions.

Uploaded by

Haseeb Rehman
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Programming Languages

A programming language allows humans to communicate instructions to computers. There are two main types: low-level languages like machine code and assembly language, which are close to what computers actually understand; and high-level languages like C++ and Python, which are easier for humans to read and write but must be translated into machine code. Programs written in high-level languages are translated by compilers or interpreters so the computer can understand and execute the instructions.

Uploaded by

Haseeb Rehman
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 8

Programming

Languages
What is a Programming
Language
 a "programming language" is a means of
communication between a human being
(programmer) and a computer

Programs
 A programmer uses this means of
communication in order to give the computer
instructions. These instructions are called
"programs".
Types of programming
languages

 Programming languages can basically be


divided in to two categories: Low-Level and
High-level,
Low-level Languages
 There are two general types of low level
"languages".

 Machine code (also called binary) is the lowest


form of a low-level language. Machine code consists
of a string of 0s and 1s, which combine to form
meaningful instructions that computers can take
action on. If you look at a page of binary it becomes
apparent why binary is never a practical choice for
writing programs; what kind of person would actually
be able to remember what a bunch of strings of 1
and 0 mean ?
 Assembly language (also called ASM), is just above machine
code on the scale from low level to high level. It is a human-
readable translation of the machine language instructions the
computer executes. For example, instead of referring to
processor instructions by their binary representation (0s and 1s),
the programmer refers to those instructions using a more
memorable (mnemonic) form. These mnemonics are usually
short collections of letters that symbolize the action of the
respective instruction, such as "ADD" for addition, and "MOV" for
moving values from one place to another.

 NOTE:
Assembly language is processor specific. This means that a
program written in assembly language will not work on
computers with different processor architectures.
Low-level Languages
 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. 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.
 High-level languages do more with less code, although
there is sometimes a loss in performance and less
freedom for the programmer. They also attempt to use
English language words in a form which can be read
and generally interpreted by the average person with
little experience in them. A program written in one of
these languages is sometimes referred to as "human-
readable code".
 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.
Translating Programming Languages

 Since a computer is only capable of understanding machine code,


human-readable code must be either interpreted or translated into
machine code.
 An interpreter is a program (often written in a lower level language) that
interprets the instructions of a program one instruction at a time into
commands that are to be carried out by the interpreter as it happens.
Typically each instruction consists of one line of text or provides some
other clear means of telling each instruction apart and the program must
be reinterpreted again each time the program is run.
 A compiler is a program that translates the instruction of a program one
instruction at a time into machine code. The translation into machine
code may involve splitting one instruction understood by the compiler
into multiple machine instructions. The instructions are only translated
once and after that the machine can understand and follow the
instructions directly whenever it is instructed to do so

You might also like