1 what is programming language? a language that is acceptable to computer system is called as...
TRANSCRIPT
1
What is Programming Language?
A language that is acceptable to computer system is called as Computer Language or Programming Language
Prepared by Mrs.Deepa Mishra
Prepared by Mrs.Deepa Mishra 2
Types of Programming Languages
Machine-Level Assembly-Level High-Level
Prepared by Mrs.Deepa Mishra 3
Machine-Level Language
Only Lang understood by computer Consist of 0’s and 1’s It has two part format
OpcodeIt tells computer what function to perform
OperandIt tells where to find or store the data, or other
instructions
Prepared by Mrs.Deepa Mishra 4
Advantages & Disadvantages
Advantages Faster Execution
Disadvantages Machine dependent Difficult to program Error prone Difficult to modify
Prepared by Mrs.Deepa Mishra 5
Assembly Language
Designed in 1952 Alphanumeric mnemonics codes instead of numeric
codes for instructions Each line consists of 4 columns [Label]<Opcode><Operand>[;comment] Example
Label Opcode Operand Comment
BEGIN ADD A,B ;Add B to A
Prepared by Mrs.Deepa Mishra 6
Advantages & Disadvantages
Advantages Easy to understand & use Easy to correct and locate errors Easy to modify
Disadvantages Machine dependent Knowledge of h/w required
Prepared by Mrs.Deepa Mishra 7
Assembler
AssemblerInput Output
Assembly Lang Program
Machine Lang Program or m/c code or object code
Definition: Converts Assembly Lang program into it’s equivalent machine
Lang program
Prepared by Mrs.Deepa Mishra 8
High-Level Languages
Overcome limitations of Low level Languages( Machine & Assembly Language)
Prepared by Mrs.Deepa Mishra 9
Compiler
CompilerInput Output
High-Level Lang Program/sourceprogram eg. Hello.c
Machine Lang Program /object program eghello.exe
Translate high levele lang. instructions into m/c lang. instructions
Prepared by Mrs.Deepa Mishra 10
Interpreter
ResultSource program Interpreter( Translates & Executes statement-by-statement)
Fig. Role of Interpreter
Translates statement-by-statement instruction into machine Lang & immediately executes resulting Machine Lang instruction
Data
Prepared by Mrs.Deepa Mishra 11
Linker
Source File 1 Source File 2 Source File 3
Compiler
Object File 1 Object File 2 Object File 3
Compiler Compiler
Linker Program Library
Executable File
Fig. Role of Linker
Prepared by Mrs.Deepa Mishra 12
Loader
Loader is component of compiler Locates given program in offline storage Loads into main memory for execution
Prepared by Mrs.Deepa Mishra 13
Advantages of High level Lang.
Machine Independent Easy to Learn and Use Less Errors
Disadvantages Lower Efficiency
Prepared by Mrs.Deepa Mishra 14
FORTRAN
FORmula TRANslation. Designed for scientific and mathematical applications by scientists and
engineers. Fortan is refered as scientific language First high level language, using first complier Algebra based language General purpose and procedural language Oldest HLL BY JOHN BACKUS Initial release of FORTAN is for IBM 704contained 32 statement. American Standard Association (ANSI)formed a committee to develop
FORTRAN
Prepared by Mrs.Deepa Mishra 15
COBOL
COmmon Business Oriented Language. Developed in 1959 (Conference on Data System languages) Best File handling capability Typically used for business applications. It is Self documenting, truly connotative ie permits both
long names (up to 30 characters) and word connector char (dashes)
It has large set of class libraries offers object oriented features , visual programming languages.
Integration with world wide web.
Prepared by Mrs.Deepa Mishra 16
BASIC
Beginner’s All-purpose Symbolic Instruction Code. Today, it is not used to develop the programs but used to teach
fundamentals of programming Interpreted language BASIC allows Loops, input from keyboard, MENU driven application ,
Structured programming. Programme Structures
REM
END
Example
PRINT “ HELLO WORD”
END
Prepared by Mrs.Deepa Mishra 17
Pascal
● Named after French philosopher and mathematician Blaise Pascal.● It is imperative and Procedural Programming language.● It is strongly typed block structured programming language● Start with keyword begin● Teaching Lang.● Platform independent● Used for scientific computational appl.● PASCAL Program :PROGRAM HelloWorld;BEGINWRITELN(“HELLOWORLD”);END
Prepared by Mrs.Deepa Mishra 18
SNOBOL
● String Oriented And Symbolic Language● It is a text string oriented languages, Oriented towards string
data handling.● It has the facility of pattern matching● SNOBOL 4 has no type declaration and no restriction on
data type so it is dynamically typed. ● Interpretive Language i.e compiler translates program into a
notation that the interpreter can easily execute.● Used as research tool rather than commercial application.● Used for analysis of Literature and music. ● Computer experts use SNOBOL for database programme.
Prepared by Mrs.Deepa Mishra 19
C
Developed at Bell Laboratories in the 1972 by Dennis Ritchie.
Provides efficiency of assembly language while having third generation language features.
Often used for system programs. UNIX is written in C. Easy to learn and use Rich set of in built functions
Prepared by Mrs.Deepa Mishra 20
C++
Developed by Bjarne Stroupstrup in 1983 It is C language with additional features. Object oriented language Designed for Unix system // title of the program //comment
# include<iostream.h>
Void main()
{
Cout<<“hello world”;
}
Prepared by Mrs.Deepa Mishra 21
JAVA
Developed by Sun Microsystem in 1991 An object-oriented language Platform independent Jvm is m/c dependent Java is complied into special machine code called byte
code and because of byte code java does not perform as fast as c++.
Applications Used to create WWW applets Used for cross platform application development to create network applications.
Prepared by Mrs.Deepa Mishra 22
LISP
● LISt Processing Language● Language based on lambda calculus. (Mathematical
notation for expressing functions.)● Oldest HLL second to Fortran.● Permit the use of recursion● Used in AI research
Prepared by Mrs.Deepa Mishra 23
MATLAB
MATrix LABoratory Possesses tools for building custom GUI Includes mathematical functions
Linear algebra, Fourier analysis, numerical integration USE
Image & signal processingIt is also known as language of technical computation.In this C, C++, java or excel code can be integrated.2D & 3D visualization options are given for better representation of
results
Prepared by Mrs.Deepa Mishra 24
Octave (Gnu octave)
• Open source free license software.• Same as MATLAB.• All commands which work in MATLAB can be used in this
software.• ADVANTAGES• Works on Windows as well as Linux.• Can give 2D & 3D graphics views.• DISADVANTAGES• Newly arrived software so may contain bugs.• Lack of proper support.• Performance is not proved till now.
Prepared by Mrs.Deepa Mishra 25
Scripting Lang
A scripting language is a form of programming language that is usually interpreted rather than compiled.
Used for web development Examples: Javascript ,vbscript,html etc Used for writing scripts Used to create GUI & forms in search engines, web
based e-mail Eg: java script, VB script,ASP,JSP, perl, ruby,tcl,shell
& python
Prepared by Mrs.Deepa Mishra 26
Scripting languages
Advantages• Easier to write code than in compiled lang. Minimum prog. Knowledge is required Allow rapid development & can communicate easily with
program written in other lang. Editing & running scripting code is fast Limitation• More time required for interpretation.• Hard to debug as no development environment is
available by default• All script. Lang. not supported by all system.• S.L are text based it is easy to modify & break by others
Prepared by Mrs.Deepa Mishra 27
Characteristics of Good PL Portability –M/c independent Simple & readable. Reliability Performance Reusability Modularity Structured programming
Prepared by Mrs.Deepa Mishra 28
Selecting Language for Coding
Selecting Lang out of many available Languages for coding an Application depending on following factors
Nature of Application-if the application is O.S intensive go for C,C++.
If app. Is O.S independent go for java Familiarity with Lang Ease of Learning Lang When developing wed page go for JSP. Execution Efficiency
Prepared by Mrs.Deepa Mishra 29
Subprograms
Subroutine is a set of instructions that perform a specific task for a main routine & transfer control back to main routine
Addition(x,y)
//code to perform intended task
header
body