Evolution%20of%20programming%20languages - PowerPoint PPT Presentation

About This Presentation
Title:

Evolution%20of%20programming%20languages

Description:

Abstract data types. Inheritance and overriding. Polymorphism ... Rule-based and pattern matching (ML, Haskell) High-order functions. Lazy evaluation (Haskell) ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 14
Provided by: NengF1
Category:

less

Transcript and Presenter's Notes

Title: Evolution%20of%20programming%20languages


1
Evolution of programming languages
  • Machine language
  • Assembly language
  • Sub-routines and loop (Fortran)
  • Procedures and recursion (Algol, Pascal, C)
  • Modules (Modula-2, Ada)
  • Objects (Simula, Smalltalk, C,Java)
  • Declarative programming languages (Prolog, CLP,
    Lisp, ML, Haskall)

2
Programming language spectrum
  • Declarative
  • Logic and constraint-based (Prolog, CLP(FD))
  • Functional (Lisp/Scheme, ML, Haskell)
  • Dataflow (Id, Val)
  • Template-based (XSLT)
  • Database (SQL)
  • Imperative
  • von Neumann (C, Ada, Fortran, Pascal,)
  • Scripting (Perl, Python, PHP,)
  • Object-oriented (Smalltalk, Effel, C, Java, C)

3
Imperative
  • Features
  • Variables are mnemonics of memory locations
  • Assignment statements
  • goto
  • Iterative constructs

4
Object-oriented
  • Features
  • Abstract data types
  • Inheritance and overriding
  • Polymorphism
  • Dynamic binding

5
Functional
  • Features
  • Single assignment variables (no side effects)
  • Recursion
  • Rule-based and pattern matching (ML, Haskell)
  • High-order functions
  • Lazy evaluation (Haskell)
  • Meta-programming (Scheme)

6
Stack in Scheme
(define stack_push (lambda (s x) (cons x
s))) (define stack_peek (lambda (s) (if (eq? s
()) (raise "empty stack") (car
s)))) (define stack_pop (lambda (s) (if (eq? s
()) (raise "empty stack") (cdr s))))
7
Stack in Haskell
stack_push s x (xs) stack_peek (x_)
x stack_pop (_s) s
8
Append in Haskell
append a -gt a -gt
a   append ys ys append (xxs)
ys x append xs ys  
9
Stack in SML/NJ
fun stack_push s x (xs) fun stack_peek
(xs) x fun stack_pop (_s) s
10
F
let stack_push s x x s   let stack_peek s
match s with x _ -gt x   let stack_pop
s match s with _ s -gt s  
11
Logic constraint-based
  • Features
  • Logic variables
  • Recursion
  • Unification
  • Backtracking
  • Meta-programming

12
Stack in Prolog
stack_push(S,X,XS). stack_pop(XS,X,S).
13
Append in Prolog
append(,Ys,Ys). append(XXs,Ys,XZs)- appe
nd(Xs,Ys,Zs).
Write a Comment
User Comments (0)
About PowerShow.com