PROGRAMMING
LANGUAGES
________
Danish Ali
Programming?
• The process of telling the computer what to do
Also known as coding
Programming
Language?
Programming Language (PL)
• A vocabulary and set of grammatical rules for
instructing a computer to perform specific
tasks
OS
• Programmers use PLs to instruct the computers
to do things.
printf("hello, world\n");
CPU
Memory
Types of Programming Languages
• High level Programming Languages
printf("hello, world\n"); OS
executable CPU
compiler
Memory
• Low Level Programming Languages
High and Low Level Languages
High Level Language Machine Level Language
• It is programmer friendly • It is a machine friendly
language. language.
• High level language is less • Low level language is high
memory efficient. memory efficient.
• It is easy to understand. • It is tough to understand.
• It is used widely for • It is not commonly used now-a-
programming. days in programming.
Continued…
• The main difference between high level language and low level
language is that, Programmers can easily understand or interpret
or compile the high level language compared to the machine. On
the other hand, Machine can easily understand the low level
language compared to human beings.
• Lying between machine languages & high-level languages are
languages called assembly languages
Assembly Languages
• Assembly languages are similar to machine languages, but are
easier to program in as they allow a programmer to substitute
names for numbers
Machine languages consist of numbers only
Translators
• Regardless of what language you use, you eventually need to
convert your program into a language that the computer can
understand
Two ways for doing that:
Compile the program or
Interpret the program
Interpreter and Compiler
•Interpreter is a program that executes
instructions written in a high-level language
An interpreter translates high-level instructions into an
intermediate form, which it then executes
In contrast, a compiler translates high-level instructions directly
into machine language
Similarities
• A Compiler and Interpreter both carry out the same purpose
• Translates a high level language (like C++, Java) instructions into the binary
form which is understandable by computer hardware (Machine language).
Compiler Interpreter
Differences
• An interpreter
• Reads one statement then translates it and executes it and then takes
another.
• Easy to check for mistake(debug) than a compiler
• Programme instructions are performed slowly
• A Compiler
• Translates the entire program in one go and then executes it.
• Hard to spot and correct mistakes
• Programme instructions are performed quickly
Uses
• An interpreter is used for program development as it is easier to
debug and partially test the code.
• Once the program is error free and complete, the program should
then be compiled, as compiling only needs to be done once.
ANY QUESTIONS?