main shared4 parbegin p1 p2 parend print shared - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

main shared4 parbegin p1 p2 parend print shared

Description:

Learn different languages, C, C , Java, Lisp, etc. ... Final grades will be posted on the Blackboard! Good luck in the finals!! Happy Holidays! ... – PowerPoint PPT presentation

Number of Views:113
Avg rating:3.0/5.0
Slides: 19
Provided by: sam73
Category:

less

Transcript and Presenter's Notes

Title: main shared4 parbegin p1 p2 parend print shared


1
main() shared4 parbegin p1() p2()
parend print shared
Quiz
  • p1()
  • shared shared 2
  • p2()
  • sharedshared2

What is the output of the concurrent program
shown above?
2
Items Due
  • Homework 7 is due (Friday)
  • Homework 8 is due (Friday)
  • You may come and talk to me about your draft for
    HW 8

3
Course Summary
4
Study programming languages Why?
  • Use of existing languages
  • Vocabulary of useful programming constructs
  • Better choice of programming languages
  • Ease of learning new languages
  • Ease of designing new languages

5
Study programming languages How?
  • Grand Tour
  • Learn different languages, C, C, Java, Lisp,
    etc.
  • Languages become obsolete and new languages are
    designed all the time.
  • Principles
  • Learn the underlying principles, vocabulary,
    structure and meaning
  • More enduring

6
If you give a man a fish he will have a single
meal. If you teach him how to fish, he will eat
all his life. Kuan-tzu (Chinese Philosopher)
7
Design Principles
  • Syntax
  • What is a correctly written program?
  • What are the basic building blocks?
  • Vocabulary of words
  • What rules guide how the words are put together
    to make a correct program?
  • Context-Free Grammars

8
Design Principles
  • Type systems and Semantics
  • What does a program/fragment/construct mean?
  • Important for program correctness.
  • Formal approaches are need to answer this
    systematically.

9
Design Principles
  • Memory Management
  • How do the program elements map to physical
    memory?
  • Variables, data structures
  • Function call, recursion
  • Static and dynamic memory
  • Dynamic memory management
  • Objects have definite life spans
  • Garbage collection
  • Essential to have an understanding

10
Design Principles
  • Exception Handling
  • How does a program prepare for unexpected events
    during its execution?
  • Division by zero
  • Improper/illegal input
  • Exceptions
  • Programs must trap exceptions and provide
    alternative paths or graceful exit.

11
Programming Paradigms
  • Many different languages
  • Only a few different styles of programming
  • Imperative Programming
  • Object-oriented Programming
  • Functional Programming
  • Logic Programming
  • Event-Driven Programming
  • Concurrent Programming

12
Imperative Programming
  • Program is a series of steps
  • Retrieves input
  • Perform some computation
  • Generates output
  • Essential building blocks
  • Assignments
  • Procedures
  • Control structures
  • Examples Fortran, C, Cobol

13
Object-oriented Programming
  • Program is a collection of objects
  • Interaction between objects is via message
    passing
  • Essential building blocks
  • Object modeling
  • Inheritance
  • Examples C, Java, Smalltalk

14
Functional Programming
  • Program is a collection of mathematical functions
  • Have one or more arguments
  • Return a value
  • Essential building blocks
  • Composition
  • Recursion
  • Examples Lisp, Scheme, ML

15
Logic Programming
  • Program is a collection of logical declarations
  • Separation of logic (what) and control (how)
  • Natural choice to express non-determinism
  • Examples Prolog

16
Event-Driven Programming
  • Program is a continuous loop
  • Wait for some event
  • Respond to the event
  • Order of event is arbitrary
  • Increased attention due to GUIs
  • Examples Visual Basic, Java

17
Concurrent Programming
  • Program is a set of cooperating processes
  • Each process works on its own
  • Shares information with others from time to time
  • Essential building blocks
  • Parallel constructs
  • Examples Linda, High Performance Fortran (HPF)

18
Goals of this course
  • Formal approach to language design
  • Careful examination of key programming paradigms
  • Hands-on programming experience
  • I hear
    and I forget!
  • I see and I remember!!
  • I do and I
    understand!!!

  • (Chinese proverb)

19
  • No class on Friday.
  • Final grades will be posted on the Blackboard!
  • Good luck in the finals!!
  • Happy Holidays!!!
Write a Comment
User Comments (0)
About PowerShow.com