UNIT 3

Programming language What is Programming language ?, The Evolution of Programming Languages , Advantages of Machine Language, Disadvantages of Machine Language, The Evolution of Programming Languages - Assembly Languages Advantages of Assembly Language, Disadvantages of Assembly Language, The Evolution of Programming Languages - Higher-Level Languages , Fourth-generation languages (4GLs) are even easier to use than 3GLs,Fifth-generation languages (5GLs) are an issue of debate in the programming community some programmers cannot agree that they even exist,Translators,Compilers,Interpreters,Assembler,Errors during Program writing,Why study programming languages,Errors during Program writing,Language Paradigms,Binding and Binding times,Static vs Dynamic Binding,.


Programming language


What is Programming language ?


A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer.
A programming language is a set of rules that provides a way of telling a computer what operations to perform.
A programming language is a set of rules for communicating an algorithm
It provides a linguistic framework for describing computations
English is a natural language. It has words, symbols and grammatical rules.
A programming language also has words, symbols and rules of grammar.
The grammatical rules are called syntax.
Each programming language has a different set of syntax rules.



The Evolution of Programming Languages


Programming languages fall into three broad categories:
Machine languages
Assembly languages
High - level languages



Advantages of Machine Language


It makes fast and efficient use of the computer i.e. execution of programs become faster.
It requires no translator to translate the code i.e. directly understood by the computer



Disadvantages of Machine Language


All operation codes have to be remembered.
All memory addresses have to be remembered.
It is hard to amend or find errors in a program written in the machine language.
These languages are machine dependent i.e. a particular machine language can be used on only one type of computer.



The Evolution of Programming Languages - Assembly Languages


Assembly languages (second-generation languages) are only somewhat easier to work with than machine languages.
To create programs in assembly language, developers use cryptic English-like phrases to represent strings of numbers.
The code is then translated into object code, using a translator called an assembler.
Easy to write as compared to machine language.



Advantages of Assembly Language


It is easier to understand and use as compared to machine language.
It is easy to locate and correct errors.
It can be modified easily



Disadvantages of Assembly Language


Like machine language it is also machine dependent.
Since it is machine dependent therefore programmer should have the knowledge of the hardware also.



The Evolution of Programming Languages - Higher-Level Languages



Higher-level languages are more powerful than assembly language and allow the programmer to work in a more English-like environment
Higher-level programming languages are divided into three "generations," each more powerful than the last:

Third-generation languages (3GLs) are the first to use true English-like phrasing, making them easier to use than previous languages

Third-generation languages (3GLs) are the first to use true English-like phrasing, making them easier to use than previous languages

3GLs are portable, meaning the object code created for one type of system can be translated for use on a different type of system


The following languages are 3GLs:

FORTAN
C
COBOL
C++
BASIC
Java
Pascal
ActiveX



Fourth-generation languages (4GLs) are even easier to use than 3GLs



Fourth-generation languages (4GLs) are even easier to use than 3GLs

4GLs may use a text-based environment (like a 3GL) or may allow the programmer to work in a visual environment, using graphical tools

The following languages are 4GLs:

dBase
FoxPro
Access
Oracle
Informix
SQL



Fifth-generation languages (5GLs) are an issue of debate in the programming community some programmers cannot agree that they even exist



Fourth-generation languages (4GLs) are even easier to use than 3GLs

4GLs may use a text-based environment (like a 3GL) or may allow the programmer to work in a visual environment, using graphical tools

The following languages are 4GLs:

dBase
FoxPro
Access
Oracle
Informix
SQL
Fifth-generation languages (5GLs) are an issue of debate in the programming community some programmers cannot agree that they even exist

These high-level languages would use artificial intelligence to create software, making 5GLs extremely difficult to develop

Solve problems using constraints rather than algorithms, used inArtificial Intelligence
Prolog
Lisp



Translators



As the computer accepts digits and characters as input, such input to be conversed into machine language
The Software which makes conversion possible and increases the productivity of the programmer are called Translators

There are three basic types of translators they are i
Compilers ii
Interpreters iii
Assembler

Compilers



A compiler is a software that will convert the high level instructions into equivalent Machine level instructions at a time

Interpreters



A Interpreter is a software that will convert the high level instructions into equivalent Machine level instructions step by step

Assembler



Assembler is a software that will convert the high level instructions into equivalent Machine level instructions but here, the input programs are in assembly language
The output is in machine language



Errors during Program writing



Generally we encounter with two types of errors while writing program.
1.Syntax Error.
2.Semantics Error.



Why study programming languages



To allow a better choice of programming language
To make it easier to learn a new language
To make it easier to design a new language





Errors during Program writing



Generally we encounter with two types of errors while writing program.
1.Syntax Error.
2.Semantics Error.



Language Paradigms



There are four basic computational models that describe most programming today: 1.Imperative
2.Declarative
3.Applicative
4.Rule based
5.Object Oriented.



Binding and Binding times



Binding-fixing a feature to have a specific value among a set of possible values.
A binding is an association,such as between an attribute and an entity,or between an operation and a symbol
Ex.-your programmay be named in different ways and when you choose a particular name you have done a binding.
Binding time is the time at which a binding takes place



Static vs Dynamic Binding



A binding is static if it first occurs before run time and remains unchanged throughout program execution.
A binding is dynamic if it first occurs during execution or can change during execution of the program.