KEMBAR78
Chapter 02 Evolution of Major Programming Languages | PDF | Object Oriented Programming | Dynamic Web Page
0% found this document useful (0 votes)
17 views70 pages

Chapter 02 Evolution of Major Programming Languages

The document discusses the evolution of programming languages, highlighting the limitations of machine code and the development of higher-level languages like MIPS, Fortran, LISP, and ALGOL. It covers the features and historical context of these languages, including their syntax, data handling, and impact on programming practices. Additionally, it emphasizes the significance of COBOL in business applications and the importance of making programming more accessible.

Uploaded by

nomanur rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views70 pages

Chapter 02 Evolution of Major Programming Languages

The document discusses the evolution of programming languages, highlighting the limitations of machine code and the development of higher-level languages like MIPS, Fortran, LISP, and ALGOL. It covers the features and historical context of these languages, including their syntax, data handling, and impact on programming practices. Additionally, it emphasizes the significance of COBOL in business applications and the importance of making programming more accessible.

Uploaded by

nomanur rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 70

Spring 2022

Slides Courtesy From :


“Concepts of Programming Languages” –by
Robert W. Sebesta.
Published by Pearson Education, Inc. USA.
Eleventh Edition. 2016

IUBAT CSC 461 01/05/25 1


2

Genealogy of Common
Languages
01/05/25
IUBAT CSC 461
Minimal Hardware Programming with
Pseudocodes
 Why programming with machine code is not
good?
 MIPS instruction: add $t0,$t1,$t8
Binary code:
00000001001110000100000000100000
 Poor readability
What does the code want to do?
 Poor modifiability
Want to change “a= b+1” to “a=c+2”
 Expression coding was tedious
Instruction format, length, ….
 Machine deficiencies(1940-50)--no indexing or
floating point

IUBAT CSC 461 01/05/25 3


MIPS instruction set
MIPS (originally an acronym for Microprocessor without Interlocked
Pipeline Stages) is a reduced instruction set computer (RISC) instruction
set (ISA) developed by MIPS Technologies (formerly MIPS Computer
Systems, Inc.).
The early MIPS architectures were 32-bit, with 64-bit versions added later.
Multiple revisions of the MIPS instruction set exist, including MIPS I, MIPS II,
MIPS III, MIPS IV, MIPS V, MIPS32, and MIPS64. The current revisions are
MIPS32 (for 32-bit implementations) and MIPS64 (for 64-bit
implementations). MIPS32 and MIPS64 define a control register set as well
as the instruction set.

Register Name Register Number Use

$t0–$t7 $8–$15 Temporaries

$s0–$s7 $16–$23 saved temporaries

$t8–$t9 $24–$25 Temporaries

IUBAT CSC 461 01/05/25 4


Pseudocodes
Short code
 Mauchly in1949 for BINAC (Binary Automatic
Computer) computers
 01 – 06 abs value 1n
(n+2)nd power
 02 ) 07 + 2n (n+2)nd root
 03 = 08 pause 4n if <= n
 04 / 09 ( 58 print and tab
 “00 x0 03 20 06 Y0” ; X0=SQRT(ABS(Y0))
 Interpreted, 50 slower
A BNF specification is a set of
Speedcoding derivation rules, written as
<symbol> ::= __expression__
 Backus in 1954 for IBM 701
 Handle --- branches, auto-increment register, floating-point
operation
 Interpreted
 Memory has 700 usable words
IUBAT CSC 461 01/05/25 5
Fortran
Came with IBM 704 system (IBM
Mathematical Formula Translating System)
 Index register and floating point instructions
Fortran I: 1957
 Environment of development
Computers were small and unreliable
Applications were scientific
No programming methodology or tools
Machine efficiency was most important
 Impacts
No need for dynamic storage
Need good array handling and counting loops
No string handling, decimal arithmetic, or
powerful input/output (commercial stuff)

IUBAT CSC 461 01/05/25 6


Fortran I
Overview
 First implemented version
 Arithmetic If-stmt: if (Expression) N1(-), N2(0),
N3(+)
 Do-stmt: (DO statement# variable = initialValue, finalValue,
optionalIncrement) In computer science, a subroutine (also called
Do N1 v=V1, V2, V3 procedure, function, routine, method, or
subprogram) is a portion of code within a larger
Post-test loop like Do-While program that performs a specific task and is
relatively independent of the remaining code.
 User-defined routines
 No data typing statements
Names start with I,J,K,L,M are integer types, others
floating point
 Fast compiled code
 Programs larger than 400 lines rarely compiled
IBM 704 was not reliable
 Widely accepted after the introduction
IUBAT CSC 461 01/05/25 7
Fortran II, IV, 77
Fortran II
 Distributed in 1958
 Independent compilation and bug fix
Fortran IV
 Type declaration
 Logical selection
 Passing subprogram as parameters
 Evolve during 1960-62, ANSI(American National Standards
Institute) standard in 1966
Fortran 77
 Character string
 Logical loop control
 If-then-else-stmt
 New standard in 1978

IUBAT CSC 461 01/05/25 8


Fortran 77
* Find greatest common divisor using the Euclidean algorithm
Example
Step k Equation Quotient and remainder
0 1071 = q0 462 + r0 q0 = 2 and r0 = 147
1 462 = q1 147 + r1 q1 = 3 and r1 = 21
2 147 = q2 21 + r2 q2 = 7 and r2 = 0; algorithm ends

PROGRAM EUCLID FUNCTION NGCD(NA, NB)


PRINT *, 'A?' IA = NA
READ *, NA IB = NB
IF (NA.LE.0) THEN 1 IF (IB.NE.0) THEN
PRINT *, 'A must be a positive integer.' ITEMP = IA
STOP IA = IB
END IF IB = MOD(ITEMP, IB)
PRINT *, 'B?' GOTO 1
READ *, NB END IF
IF (NB.LE.0) THEN NGCD = IA
PRINT *, 'B must be a positive integer.' RETURN
STOP END
END IF
PRINT *, 'The GCD of', NA, ' and', NB, ' is', NGCD(NA, NB), '.'
STOP
END

IUBAT CSC 461 01/05/25 9


Fortran 90
 Significant changes C++: the static array is created at
the compile time where as the
 Modules dynamic array is created on the
run time. Where as the difference
 Dynamic arrays as far is concerned with their
memory locations the static are
 Pointers located on the stack and the
dynamic are created on the heap.
 Recursion
 Multiple Selection JAVA : The ArrayList class
supports dynamic arrays that can
Statement grow as needed. Standard Java
arrays are of a fixed length.
 FORTRAN became After arrays are created, they
cannot grow or shrink, which means
Fortran that you must know in advance how
many elements an array will hold.

IUBAT CSC 461 01/05/25 10


Fortran
Evaluation
Highly optimizing compilers
For all versions before Fortran 90
Types and storage of all variables are fixed at
compile-time
Less flexible but very efficient

The first widely used high-level language

Changed forever the way computers are used


Characterized as the lingua franca of the
computing world

IUBAT CSC 461 01/05/25 11


computing as lingua franca

IUBAT CSC 461 01/05/25 12


Lambda Calculus

IUBAT CSC 461 01/05/25 13


Lambda Calculus

IUBAT CSC 461 01/05/25 14


Lambda Calculus
 The λ-calculus incorporates two simplifications that make this
semantics simple. The first simplification is that the λ-calculus
treats functions "anonymously", without giving them explicit
names.
 For example, the function sqsum(x, y) = x X x + y
Xy
 can be rewritten in anonymous form as (x, y)  x X x + y X y
 The second simplification is that the λ-calculus only uses
functions of a single input. An ordinary function that requires
two inputs, for instance the function, can be reworked into an
equivalent function that accepts a single input, and as output
returns another function, that in turn accepts a single input. For
example,
 (x, y)  x X x + y X y
 can be reworked into
 (x  ( y  x X x + y X y )
 This method, known as currying, transforms a function that
takes multiple arguments into a chain of functions each with a
single argument. 15
IUBAT CSC 461 01/05/25
Functional Programming:
LISP
LISt Processing language
 Designed at MIT by McCarthy
 Based on lambda calculus
AI research needed a language to
 Process data in lists (rather than arrays)
 Symbolic computation (rather than numeric)
Only two data types
 atoms and lists
 Examples:
 ( A B C D)
(A (B C) D (E (F G) ) )
 (A (B) C D (E (F G(H I)) ) ) ?
 (P Q (R S) T (U ( V W)) X) ?

IUBAT CSC 461 01/05/25 16


IUBAT CSC 461 01/05/25 17
Example
The following code defines a LISP predicate function [Boolean-
valued function P: X→ {true, false}, called the predicate on
X] that takes two lists as arguments and returns True if the
two lists are equal, and NIL (false) otherwise
(DEFUN Equal_lst (lst1 lst2)
(COND
( (ATOM lst1) (EQ lst1 lst2) )
( (ATOM lst2) nil )
( ( Equal_lst (CAR lst1) (CAR lst2) )
( Equal_lst (CDR lst1) (CDR lst2) ) )
( T nil)
)
)
The car operation returns the first element of
the list, while cdr returns the rest of the list.

IUBAT CSC 461 01/05/25 18


LISP
Evaluation
 Pioneered functional programming
 No need for variables or assignment
 Control via recursion and conditional
expressions
 Still the dominant language for AI
 COMMON LISP and Scheme are
contemporary dialects of LISP
 ML, Miranda, and Haskell are related
languages
IUBAT CSC 461 01/05/25 19
Scheme and COMMON LISP
Scheme The scope of a variable or
procedure name – or
generally any kind of name –
Developed at MIT in mid 1970s within a program is the
Small portion of the program in
which that name is
Extensive use of static scoping
associated with a particular
variable, procedure or other
Functions as first-class entities
entity.
Simple syntax (and small size) make it
ideal for educational applications
COMMON LISP
An effort to combine features of several
dialects of LISP into a single language
Large, complex

IUBAT CSC 461 01/05/25 20


The First Step Toward
Sophistication
 To design a universal language ?

 Environment of development
 FORTRAN had (barely) arrived for IBM 70x
 Many other languages were being developed, all
for specific machines
 No portable language; all were machine-
dependent
 No universal language for communicating
algorithms

 International ALGOrithmic Language


IUBAT CSC 461 01/05/25 21
ALGOL 58
 Concept of type was formalized
 Names could be any length
 Arrays could have any number of subscripts
 Parameters were separated by mode (in & out)
 Subscripts were placed in brackets
 Compound statements (begin ... end)
 Semicolon as a statement separator
 Assignment operator was :=
 if had an else-if clause

 Not meant to be implemented


 IBM dropped its support in mid 1959

IUBAT CSC 461 01/05/25 22


ALGOL 60
Overview
 Modified ALGOL 58 at 6-day meeting
in Paris
Block-structured
 New features programming
languages allow scope
to be restricted to
 Block structure (local scope) a block, which is known
as block scope. This
 Two parameter passing methods began with ALGOL 60,
where every declaration
 Subprogram recursion is valid only for that
block.
 Stack-dynamic arrays
 Still no I/O and no string handling

IUBAT CSC 461 01/05/25 23


ALGOL 60
Evaluation
Successes
 It was the standard way to publish algorithms for over 20
years
 All subsequent imperative languages are based on it
 First machine-independent language
 First language whose syntax was formally defined (BNF)

Failure
 Never widely used, especially in U.S.
 Reasons
 Lack of I/O and the character set made programs non-
portable
 Too flexible--hard to implement ALGOL68
 Formal syntax description
 Lack of support from IBM

IUBAT CSC 461 01/05/25 24


Example
BNF:
<block>  <decl><stmt-lst>
< stmt-lst>  <stmt-lst> <stmt>
<stmt>  <assign-stmt> | <for-stmt> | …
<for-stmt>  for <assign-stmt> step <int-var> until <int-
var> do <block>

Program:
begin
integer array intlst[1:99];
integer listlen, counter, sum, average, result;
sum: =0;

for counter:=1 step 1 until listlen do
begin
readint (intlst[counter]);

end;
end

IUBAT CSC 461 01/05/25 25


Computerizing Business Records:
COBOL

 Environment of development
 UNIVAC was beginning to use FLOW-MATIC
 USAF was beginning to use AIMACO
 IBM was developing COMTRAN

IUBAT CSC 461 01/05/25 26


COBOL
Designs
First Design Meeting (Pentagon) - May
1959
Design goals
 Must look like simple English
 Must be easy to use, even if that means it will be less
powerful
 Must broaden the base of computer users
 Must not be biased by current compiler problems

Design committee members were all from


computer manufacturers and DoD
branches
Design Problems: arithmetic expressions?
subscripts? Fights among manufacturers
IUBAT CSC 461 01/05/25 27
COBOL
Evaluation
Contributions
 First macro facility in a A macro in computer
science is a rule
high-level language or pattern that
 Hierarchical data structures (records)
specifies how a certain
 Nested selection statements input sequence should
be mapped to a
 Long names (up to 30 characters),
replacement output
with hyphens sequence according to
a defined procedure.
 Separate data division
The mapping process
that instantiates
First language required by DoD (transforms) a macro
 would have failed without DoD use into a specific
sequence is known
Still the widely used business applications
as macro expansion.
language
IUBAT CSC 461 01/05/25 28
IUBAT CSC 461 01/05/25 29
COBOL
Identification division
The identification division identifies the following
code entity and contains the definition of a class or
interface.

Environment division
The environment division contains the
configuration section and the input-output section.
The configuration section is used to specify
variable features such as currency signs, locales
and character sets. The input-output section
contains file-related information.

IUBAT CSC 461 01/05/25 30


Data division
COBOL
The data division is split into six sections which declare
different items: the file section, for file records; the
working-storage section, for static variables; the local-
storage section, for automatic variables; the linkage
section, for parameters and the return value; the report
section and the screen section, for text-based user
interfaces.

Procedure Division
The sections and paragraphs in the procedure division
(collectively called procedures) can be used
as labels and as simple subroutines. Unlike in other
divisions, paragraphs do not need to be in
sections. Execution goes down through the procedures
of a program until it is terminated. To use procedures
as subroutines, the PERFORM verb is used.
IUBAT CSC 461 01/05/25 31
IUBAT CSC 461 01/05/25 32
Everything for Everybody:
PL/I
 Computing situation in 1964 (IBM's point
of view)
 Scientific computing
IBM 1620 and 7090 computers
FORTRAN
SHARE user group
 Business computing
IBM 1401, 7080 computers
COBOL
GUIDE user group
 Solution
 Build a new computer for both
 Design a new language for both
IUBAT CSC 461 01/05/25 33
PL/I: Evaluation
 PL/I contributions Program unit that can be in
concurrent execution with
 First unit-levelconcurrency (executing
other tasks)
program units.
 First exception handling(detect & handle run time
errors)
 Switch-selectable recursion procedure (Could be
disabled also) For example, TABLE(*,1)
 First pointer data type refers to all of the elements
in the first column of TABLE.
 First array cross sections
It specifies the cross section
(The third row of a matrix)
consisting of TABLE(1,1),
TABLE(2,1), TABLE(3,1), and
 Concerns
TABLE(4,1).
 Many new features were
The subscripted name
poorly designed TABLE(2,*) refers to all of
 Too large and too complex
the data items in the second
row of TABLE.
IUBAT CSC 461 01/05/25 34
TABLE(*,*) refers to the
The Beginning of Timesharing:
BASIC
Designed by Kemeny & Kurtz at Dartmouth
Design Goals: In computing, time-
sharing is
 Easy to learn and use for the sharing of a
computing resource
non-science students among many users by
 Must be “pleasant and friendly”means of
 Fast turnaround for homework multiprogramming
multi-tasking at
and
the
 Free and private access same time. Its
introduction in the 1960s
 User time is more important than
and emergence as the
computer time prominent model of
computing in the 1970s
 Current popular dialect: Visual BASIC
represented a major
technological shift in the
 First widely used language with time
history of computing
sharing
IUBAT CSC 461 01/05/25 35
IUBAT CSC 461 01/05/25 36
The Beginning of Data
Abstraction:
 Designed primarily
SIMULA 67
for system simulation
in Norway by Nygaard and Dahl
Coroutines are
 Based on ALGOL 6O and computer program
components that
SIMULA I generalize
subroutines for
 Primary Contributions nonpreemptive
multitasking, by
 Co-routines - a kind of subprogram
allowing multiple
entry points for
 Implemented in a structure suspending and
resuming execution
called a class at certain locations.
 Classes are the basis for data abstraction
 Classes are structures that include both local
data and functionality
IUBAT CSC 461 01/05/25 37
Preemptive VS non-
preemptive
Preemptive multitasking is task in which a computer
operating system uses some criteria to decide how long to
allocate to any one task before giving another task a turn
to use the operating system.

The act of taking control of the operating system from


one task and giving it to another task is called preempting.
Cooperative multitasking, also known as non-
preemptive multitasking, is a style of computer
multitasking in which the operating system never initiates
a context switch(Execution Context) from a
running process to another process.

Instead, processes voluntarily yield control periodically or


when idle in order to enable multiple applications to be run
simultaneously.

This type of multitasking is calledIUBAT


"cooperative"
CSC 461 01/05/25 because 38
Orthogonal Design: ALGOL
68
The continued development of ALGOL
60 but not a superset
Source of several new ideas
 based on the concept of orthogonality
Contributions
 User-defined data structures
 Reference types
 Dynamic arrays (called flex arrays)

Impacted all imperative languages


 Pascal, C, Modula/Modula 2, Ada, C++/Java,
Perl
IUBAT CSC 461 01/05/25 39
Pascal - 1971

 Developed by Wirth (a member of the


ALGOL 68 committee)
 Designed for teaching structured
programming
 Small, simple, nothing really new
 Largest impact on teaching
programming
 From mid-1970s until the late 1990s, it was
the most widely used language for
teaching programming
IUBAT CSC 461 01/05/25 40
C - 1972
 Designed for systems programming (at
Bell Labs by Dennis Richie)
 Evolved primarily from BCLP(Basic
Combined Programming
Language), B, but also ALGOL 68
 Powerful set of operators, but poor type
checking
 Initially spread through UNIX
 Many areas of application

IUBAT CSC 461 01/05/25 41


Perl
Related to ALGOL only through C
A scripting language
 A script (file) contains instructions to be executed
Developed by Larry Wall
Perl variables are statically typed and
implicitly declared
 Three distinctive namespaces, denoted by the first
character of a variable’s name [scalar variable ($),
array names(@), Hash names (%)].
Powerful but somewhat dangerous
Widely used as a general purpose
language
IUBAT CSC 461 01/05/25 42
Statically Typed
In a statically typed language, every variable name is
bound both
Language
•to a type (at compile time, by means of a data declaration)
•to an object.
The binding to an object is optional — if a name is not bound
to an object, the name is said to be null.

Once a variable name has been bound to a type (that is,


declared) it can be bound (via an assignment statement) only
to objects of that type; it cannot ever be bound to an object of
a different type. An attempt to bind the name to an object of
the wrong type will raise a type exception.

IUBAT CSC 461 01/05/25 43


Perl
Example

IUBAT CSC 461 01/05/25 44


Programming Based on Logic:
Prolog
 Developed, by Comerauer and Roussel
(University of Aix-Marseille), with help
from Kowalski ( University of Edinburgh)
 Based on formal logic
 Non-procedural
 Can be summarized as being an
intelligent database system that uses
an inferencing process to infer the
truth of given queries
 Highly inefficient, small application
areas
IUBAT CSC 461 01/05/25 45
man(adam).
man(peter).
man(paul). Prolog
woman(marry). Example
woman(eve).

parent(adam,peter). % means adam is parent of peter


parent(eve,peter).
parent(adam,paul).
parent(marry,paul).

father(F,C):-man(F),parent(F,C).
mother(M,C):-woman(M),parent(M,C).

?-father(X,paul).

IUBAT CSC 461 01/05/25 46


History’s Largest Design
Effort: Ada
 Huge design effort, involving
hundreds of people, much money,
and about eight years
 Strawman requirements (April 1975)
 Woodman requirements (August 1975)
 Tinman requirements (1976)
 Ironman equipments (1977)
 Steelman requirements (1978)
 Named Ada after Augusta Ada Byron,
known as being the first programmer
IUBAT CSC 461 01/05/25 47
Ada Evaluation
 Contributions A package is a
namespace that
 Packages - support for data abstraction
organizes a set
 Exception handling - elaborate of related
classes and
 Generic program units interfaces.
 Concurrency - through the tasking model
Conceptually you
can think
 Comments of packages as
being similar to
 Competitive design different folders
 Included all that was then known about
on software your
engineering and language design computer.
 First compilers were very difficult; the first really
usable compiler came nearly five years after the
language design was completed

IUBAT CSC 461 01/05/25 48


Generic unit
The idea of code reuse arises from the
necessity for constructing large software
systems combining well-established building
blocks.

The reusability of code improves the


productivity and the quality of software.

The generic units are one of the ways in which


the Ada language supports this characteristic.

A generic unit is a subprogram or package


that defines algorithms in terms of types and
operations that are not defined until the user 49
IUBAT CSC 461 01/05/25
Ada 95

 Ada 95 (began in 1988)


 Support for OOP through type derivation
 Better control mechanisms for shared
data
 New concurrency features
 More flexible libraries

 Popularity suffered because the DoD


no longer requires its use but also
because of popularity of C++
IUBAT CSC 461 01/05/25 50
IUBAT CSC 461 01/05/25 51
Object-Oriented Programming:
Smalltalk
 Developed at Xerox PARC, initially by
Alan Kay, later by Adele Goldberg
 First full implementation of an object-
oriented language (data abstraction,
inheritance, and dynamic type binding)
 Pioneered the graphical user interface
design
 Promoted OOP

IUBAT CSC 461 01/05/25 52


Dynamically Typed
In a dynamically typed language, every
Language
variable name is (unless it is null) bound only to
an object.

Names are bound to objects at execution time by


means of assignment statements, and it is
possible to bind a name to objects of different
types during the execution of the program.

IUBAT CSC 461 01/05/25 53


Combining Imperative and
Object-Oriented Programming: C++
Developed at Bell Labs by Stroustrup in
1980
Evolved from C and SIMULA 67
Facilities for object-oriented programming,
taken partially from SIMULA 67
Provides exception handling
A large and complex language, in part because
it supports both procedural and OO
programming
Rapidly grew in popularity, along with OOP
ANSI standard approved in November 1997
Microsoft’s version (released with .NET in
2002): Managed C++
 delegates, interfaces, no multiple inheritance
IUBAT CSC 461 01/05/25 54
Related OOP Languages
Objective-C (designed by Brad Cox –
early 1980s)
C plus support for OOP based on Smalltalk
Uses Smalltalk’s method calling syntax
Used by Apple for systems programs
Delphi (Borland)
Pascal plus features to support OOP
More elegant and safer than C++
Go (designed at Google - 2009)
Loosely based on C, but also quite different
Does not support traditional OOP

IUBAT CSC 461 01/05/25 55


IUBAT CSC 461 01/05/25 56
IUBAT CSC 461 01/05/25 57
IUBAT CSC 461 01/05/25 58
An Imperative-Based
Object-Oriented Language:
Java
 Developed at Sun in the early 1990s
 C and C++ were not satisfactory for
A Java applet is
embedded electronic devices a small
dynamic Java
 Based on C++ program that
 Significantly simplified (does notcan be
transferred via
 include Struct,union,enum, the Internet
and run by a
pointer arithmetic, etc.) Java-
 Supports only OOP compatible
Web browser.
 Has references, but not pointers
 Includes support for applets and a form of
concurrency
IUBAT CSC 461 01/05/25 59
Java Evaluation
 Eliminated unsafe features of C++
 Concurrency features
 Libraries for applets, GUIs, database
access
 Portable: Java Virtual Machine
concept, JIT compilers
 Widely used for WWW pages
 Use for other areas increased faster
than any other language
IUBAT CSC 461 01/05/25 60
Scripting Languages for the
Web
JavaScript
 A joint venture of Netscape and Sun Microsystems
 Used in Web programming (client side) to create
dynamic HTML documents
 Related to Java only through similar syntax
PHP
 PHP: Hypertext Preprocessor
 Used for Web applications (server side); produces
HTML code as output
Python
 An OO interpreted scripting language
 Type checked but dynamically typed
 Supports CGI(Common Gateway Interface) and form
processing

IUBAT CSC 461 01/05/25 61


Javascript
 Dynamic typing
X=10;…..; x=“ten”;
8+8=? … … 8+”8”=? …… “8”+8 =?
 Embedded Javascript example

IUBAT CSC 461 01/05/25 62


PHP Example

 Server side script vs Client side script

IUBAT CSC 461 01/05/25 63


Server side vs Client
side
Client-side Environment
The client-side environment used to run scripts is
usually a browser. The processing takes place on the
end users computer.
The source code is transferred from the web server
to the users computer over the internet and run
directly in the browser.
Server-side Environment
The server-side environment that runs a
scripting language is a web server. A user's
request is fulfilled by running a script directly on
the web server to generate dynamic HTML pages.
This HTML is then sent to the client browser. It is
usually used to provide interactive web sites that
interface to databases or otherIUBAT
data stores on the
CSC 461 01/05/25 64
A C-Based Language for the
New Millennium: C#
 Part of the .NET development platform
 Based on C++ , Java, and Delphi
 Provides a language for component-based
software development
 All .NET languages (C#, Visual BASIC.NET,
Managed C++, J#.NET, and Jscript.NET)
use Common Type System (CTS), which
provides a common class library
 Likely to become widely used

IUBAT CSC 461 01/05/25 65


Markup/Programming Hybrid
Languages
 XSLT
 eXtensible Markup Language (XML): a
metamarkup language
 eXtensible Stylesheet Language Transformation
(XSTL) transforms XML documents for display
 Programming constructs (e.g., looping)

 JSP
 Java Server Pages: a collection of technologies
to support dynamic Web documents
 servlet: a Java program that resides on a Web
server; servlet’s output is displayed by the
browser

IUBAT CSC 461 01/05/25 66


Exampl
e
XML format and XSL file

IUBAT CSC 461 01/05/25 67


JSP
Example

IUBAT CSC 461 01/05/25 68


Response message
<html>
<h2>You'll have a luck day!</h2>
<p>(0.987)</p>
<a href="first.jsp"><h3>Try Again</h3></a>
</html>
OR

<html>
<h2> Well, life goes on ... </h2>
<p>(0.501)</p>
<a href="first.jsp"><h3>Try Again</h3></a>
</html>
IUBAT CSC 461 01/05/25 69
Summar
y
 Development of major programming
languages
 Development environment
 Evolution

 Perspective into current issues in


language design

IUBAT CSC 461 01/05/25 70

You might also like