Programming Languages Technology | Algorithm | Data Structures | Design | Implementation | Markup Languages | Machine | Computer | Programs | Drives | Robots | Generally | Flow | Theory

Introduction of Programming Languages

   Uploaded by Shariq mehdi.

Programming Languages :-

  • What is a programming language?
  • Why are there so many programming languages?
  • What are the types of programming languages?
  • Does the world need new language?

What is a programming language?

  1. A programming language is a set of rules that provides a way of telling a computer what operations to perform.                                                                                                     
  2. A programming language is a set of rules for communicating an algorithm.                       
  3. It provides a linguistic framework for describing computations.



''A programming language is a notational system for describing computation in a machine-readable and human-readable form.''

OR

''A programming language is a tool for developing executable models for a class of problem domains.''

  1. English is a natural language. It has words, symbols and grammatical rules.                                 
  2. A programming language also has words, symbols and rules of grammar.                                     
  3. The grammatical rules are called syntax.                                                                                         
  4. Each programming language has a different set of syntax rules.                                                     

Why are there so many programming languages?

  1. Why does some people speak French?                                                                                           
  2.  Different programming languages are designed for different types of programs.                          
  3. Programming languages have evolved over time as better ways have been developed to design them.
    • First programming languages were developed in the 1950s.
    • Since then thousands of languages have been developed. 

Programming Languages Popularity (2015- 2019) :-


Levels of Programming Languages :-

High-Level Program :-

''class Triangle
{
...
float surface() return b*h/2;
 }''

Low-Level Program :-

''LOAD r1,b 
LOAD r2,h 
MUL r1,r2 
DIV r1,#2 
RET''

Executable Machine Code :-


''0001001001000101

0010010011101100

10101101001...''                                                                                             

What are the types of programming languages?

  1. First Generation Programming Languages.
  2. Second Generation Programming Languages.
  3. Third Generation Programming Languages.
  4. Fourth Generation Programming Languages.
  5. Fifth Generation Programming Languages.                                                                                             

First Generation Programming Languages :-

  1. Machine language                                                                                                             
    • Operation code – such as addition or subtraction.
    • Operands – that identify the data to be processed.
    • Machine language is machine dependent as it is the only language the computer can understand.
    • Very efficient code but very difficult to write.

Second Generation Programming  Languages :-

  1. Assembly language                                                                                                             
    • Symbolic operation codes replaced binary operation codes.
    • Assembly language programs needed to be “assembled” for execution by the computer. Each assembly language instruction is translated into one machine language instruction.
    • Very efficient code and easier to write.      

Third Generation Programming  Languages :-

  1. Alternative to compilation is interpretation which is accomplished by a system program called an interpreter.                                                                                                            
  2. Common third generation languages
    • FORTRAN
    • COBOL 
    • C and C++
    • Visual Basic                                                                                                                          
  3. Closer to English but included simple mathematical notation.                                                                                                           
    • Programs written in source code which must be translated into machine language programs called object code.
    • The translation of source code to object code is accomplished by a machine language system program called a compiler.                                                                

Fourth Generation Programming  Languages :-

  1. A high level language (4GL) that requires fewer instructions to accomplish a task than a third generation language.                                                                                                         
  2. Used with databases 
    • Query languages
    • Report generators
    • Forms designers 
    • Application generators

Fifth Generation Programming  Languages :-

  1. Declarative languages                                                                                                             
  2. Functional(?): Lisp, Scheme, SML 
    • Also called applicative
    • Everything is a function                                                                                                   
  3. Logic: Prolog
    • Based on mathematical logic
    • Rule- or Constraint-based
Beyond Fifth Generation Languages :-
  1. Though no clear definition at present, natural language programs generally can be interpreted and executed by the computer with no other action by the user than stating their question.
  2. Limited capabilities at present.

Programming Languages Family Tree:-



The Principal Paradigms :-
  1. Imperative Programming (C)   
  2. Object-Oriented Programming (C++) 
  3. Logic/Declarative Programming (Prolog)
  4. Functional / Applicative Programming (Lisp)

Programming Languages :-  
  1. Two broad groups
    • Traditional programming languages 
      • Sequences of instructions.
      • First, second and some third generation languages.                                                                                                                                                                          
    • Object-oriented languages 
      • Objects are created rather than sequences of instructions.                  
      • Some third generation, and fourth and fifth generation languages.

Traditional programming languages :-

    • Developed by Bell Laboratories in the early 1970s.
    • Provides control and efficiency of assembly language while having third generation language features.
    • Often used for system programs.
    • UNIX is written in C.                                                                                                 
  1. BASIC 
    • Beginner’s All-purpose Symbolic Instruction Code.
    • Developed at Dartmouth College in mid 1960s. 
    • Developed as a simple language for students to write programs with which they could interact through terminals.                                                                              
  2. COBOL
    • Common Business Oriented Language.
    • Developed in 1959.
    • Designed to be common to many different computers.
    • Typically used for business applications.                                                                  
  3. FORTRAN
    • Formula Translation.
    • Developed at IBM in the mid-1950s.
    • Designed for scientific and mathematical applications by scientists and engineers.                                                                                

A Language is a Languages:-

  1. Programming languages are languages.
  2. When it comes to mechanics of the task, learning to speak and use a programming language is in many ways like learning to speak a human language. 
  3. In both kind of languages you have to learn new vocabulary, syntax and semantics (new words, sentence structure and meaning) 
  4. And both kind of language require considerable practice to make perfect.                                                                         
Special Programming Languages :-

  1. Scripting Languages                                                                                                                                                                  
    • JavaScript and VBScript 
    •  Php and ASP      
    • Perl and Python                                                                                                                                                                  
  2. Command Languages                                                                                                                                                                  
    • sh, csh, bash                                                                                                                                                                  
  3. HTML                                                                                                                                                                
    • HyperText Markup Language.
    • Used on the Internet and the World Wide Web (WWW).
    • Web page developer puts brief codes called tags in the page to indicate how the page should be formatted.                                                                                                                                                                
  4. XML                                                                                                                                                                
    • Extensible Markup Language.                         
    • A language for defining other languages.                                                                                                                                                                
  5. Text processing Languages                                                                                                                                                                  
    • LaTex, PostScript                                                                                                                                              

Object-Oriented Programming Languages :-

  1. JAVA        
    • An object-oriented language similar to C++ that eliminates lots of C++’s problematic features
    • Allows a web page developer to create programs for applications, called applets that can be used through a browser.                     
    • Objective of JAVA developers is that it be machine, platform and operating system independent.                                                                                                                                                                   
  2. C++                                                                                          
    • It is C language with additional features.
    • Widely used for developing system and application software.
    • Graphical user interfaces can be developed easily with visual programming tools.                                                                                                                                      
  3. Smalltalk 
    • First purely object-oriented language.
    • Developed by Xerox in mid-1970s.     
    • Still in use on some computers.                                                                                                                                                    
  4. Simula
    • First object-oriented language 
    • Developed by Ole Johan Dahl in the 1960s.                                                              
But There is a difference :-

  1. Computer languages lack ambiguity and vagueness.
  2. In English sentences such as I saw the man with a telescope (Who had the telescope?) or Take a pinch of salt (How much is a pinch?). 
  3. In a programming language a sentence either means one thing or it means nothing.       
What determines a ''good'' languages :-

  1. Formerly: Run-time performance                                                                                      
    • (Computers were more expensive than programmers)                                                  
  2. Now: Life cycle (human) cost is more important                                                                                  
    • Ease of designing, coding 
    • Debugging                   
    • Maintenance                            
    • Reusability                                                                                                                                                                    
  3. FADS 

Criteria in a good languages design :-

  1. Writability:- The quality of a language that enables a programmer to use it to express a computation clearly, correctly, concisely, and quickly.
  2. Readability:- The quality of a language that enables a programmer to understand and comprehend the nature of a computation easily and accurately.
  3. Orthogonality:- The quality of a language that features provided have as few restrictions as possible and be combinable in any meaningful way.
  4. Reliability:- The quality of a language that assures a program will not behave in unexpected or disastrous ways during execution. 
  5. Maintainability:- The quality of a language that eases errors can be found and corrected and new features added.
  6. Generality:-The quality of a language that avoids special cases in the availability or use of constructs and by combining closely related constructs into a single more general one.
  7. Uniformity:- The quality of a language that similar features should look similar and behave similar. 
  8. Extensibility:- The quality of a language that provides some general mechanism for the user to add new constructs to a language.
  9. Standardability:- The quality of a language that allows programs written to be transported from one computer to another without significant change in language structure. 
  10. Implementability:- The quality of a language that provides a translator or interpreter can be written. This can address to complexity of the language definition. 

Programming Languages Rank :-


Does the world need new programming language?

  1. If computer hardware advances far beyond what we have today, for example, quantum computers, then more languages may be needed.
  2. For existing computers today, no, the languages we have are more than sufficient.
  3. The reason we see new programming languages arriving is because many people are looking for the Holy Grail of languages, the “perfect” programming language.
  4. The language that will make programming easier or faster or safer.
  5. It’s largely a waste of effort because the languages that are most commonly used today can do it all.
  6. There can be no such thing as a perfect programming language.                                              

Comments