CS 152: Programming Language Paradigms January 27 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak.

Slides:



Advertisements
Similar presentations
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Advertisements

Principles of programming languages 1: Introduction (with a simple language) Isao Sasano Department of Information Science and Engineering.
Introduction to Programming Languages Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Programming Languages
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. slide 1 CS 125 Introduction to Computers and Object- Oriented Programming.
Programming Languages Structure
Computability to Practical Computing - and - How to Talk to Machines.
Introduction to C++ Programming CS 117 Section 2 and KNET Sections Spring 2001 MWF 1:40-2:30.
Outline Chapter 1 Hardware, Software, Programming, Web surfing, … Chapter Goals –Describe the layers of a computer system –Describe the concept.
CS 153: Concepts of Compiler Design August 25 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
CS 185C: The History of Computing August 24 Class Meeting Department of Computer Science San Jose State University Fall 2011 Instructor: Ron Mak
CS 235: User Interface Design January 22 Class Meeting
Programming Language Concepts
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
COMP313A Programming Languages Introduction. More Housekeeping Stuff Reading Material Textbook –Programming Languages: Principles and Practice by Kenneth.
PROGRAMMING LANGUAGES The Study of Programming Languages.
BIT Presentation 6. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
CSE 425: Intro to Programming Languages and their Design A Few Key Ideas No particular language is a prerequisite for this course –However you should be.
Introduction COMP104: Fundamentals and Methodology.
CS 152: Programming Language Paradigms February 3 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak.
CS 1 •This is Computer Science 1. •Who is Professor Adams?
CS 149: Operating Systems January 22 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Alexandria University Faculty of Science Computer Science Department Introduction to Programming (CS 102) C++ Programminhg.
CS2303 C14 Systems Programming Concepts Bob Kinicki.
CS 153: Concepts of Compiler Design August 24 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 235: User Interface Design August 25 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann.
Computer system overview1 The Effects of Computers Pervasive in all professions How have computers affected my life? How have computers affected my life?
Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
CS 152: Programming Language Paradigms February 10 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak.
February 25, ICE 1341 – Programming Languages (Lecture #1) In-Young Ko Programming Languages (ICE 1341) Lecture #1 Programming Languages (ICE 1341)
1 Programming Languages Marjan Sirjani Course web site:
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Chapter 6 Programming Languages (1) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
CS 153: Concepts of Compiler Design August 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Introduction to computers and programming Instructor: Alex Iskold.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
CS 152: Programming Language Paradigms January 29 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak.
Engr. Isabelo Jun D. Paat, ME-CoE Lecturer 1 Programming Languages.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Software Engineering Algorithms, Compilers, & Lifecycle.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
History. Development Driven by Function Functions of a Programming Language –To describe computation for use by computers –To describe computation and.
Zuse’s Plankalkül – 1945 Never implemented Problems Zuse Solved
CS 153: Concepts of Compiler Design August 24 Class Meeting
Why study programming languages?
PROGRAMMING LANGUAGES
CSCI-235 Micro-Computer Applications
课程名 编译原理 Compiling Techniques
CMPE 152: Compiler Design January 25 Class Meeting
Programming COMP104: Fundamentals and Methodology Introduction.
Compiler Construction
CMPE 152: Compiler Design August 21 Class Meeting
Low Level Programming Languages
CMPE 152: Compiler Design January 24 Class Meeting
Principles of Programming Languages
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Programming Languages, Preliminaries, History & Evolution
ICS103 Programming in C 1: Overview of Computers And Programming
CMPE 152: Compiler Design August 22 Class Meeting
Presentation transcript:

CS 152: Programming Language Paradigms January 27 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 2 CS 152: Programming Language Paradigms  Instructor: Ron Mak  Faculty website:  Office hours: MW 7:15 - 8:30 pm in MH 413

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 3 Course Notes  Class website Green sheet Lecture notes and handouts Assignments  Required textbook: Programming Languages: Principles and Practice, 3 rd edition by Kenneth Louden and Kenneth Lambert _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 4 Goals of the Course  Program in languages from different “cultures”. Learn new ideas and concepts. Apply the new concepts to your “native” language.  C++, Java, etc. Become a better programmer!  Different programming cultures (paradigms). Object-oriented  C++, C#, Objective C, Java, etc. Functional  Lisp, Scheme, ML, Haskell, F# Logic  Prolog

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 5 Goals of the Course  How are programming languages designed? Can we design a language? What are the design criteria? How can we specify the language’s syntax and semantics? What about data types and control structures?  How are programming languages implemented? Interpreters Compilers _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 6 Course Overview  First half: Mostly about culture. Introduction Design criteria Functional paradigm Logic paradigm Object-oriented paradigm Syntax and semantics  Midterm  Second half: Mostly about design and implementation Data types and control structures Abstract data types Formal semantics Introduction to compilers and interpreters  Final

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 7 Small Teams  You will learn better by working in small teams.  Form your own teams of 2 or 3 students each. Choose your team members wisely!  Be sure you’ll be able to meet and communicate with each other and work together well.  After forming a team, no moving to another team. Each team member will receive the same score on the team assignments. me your team name and the list of team members and addresses by Monday, February 3:

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 8 Individual Responsibilities You are personally responsible for participating and contributing to your team’s work, and for understanding each part of the work for every assignment, whether or not you worked on that part.

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 9 Postmortem Assessment Report  At the end of the semester, each student will individually turn in a short (1 page) report: A brief description of what you learned in the course.  An assessment of your personal accomplishments for your project team. An assessment of each of your project team members. _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 10 Individual Student’s Overall Class Grade  60% assignments (team scores)  15% midterm exam (individual score)  25% final exam (individual score)  Final letter grade based on the class curve.  Participation will be important! Can move your final grade up or down, especially in borderline cases. Participation in class. Participation in your team.  As reported by the postmortem assessment reports. _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 11 Take roll!

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 12 Introduction  How we program computers influences how we think about computation, and vice versa.  The basic principles and concepts of programming languages are part of the fundamental body of computer science knowledge. The study of these principles is essential to programmers and to computer scientists.  We will study principles and concepts. The languages we examine will illustrate how to apply these principles and concepts. Not a “language of the week” class. _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 13 More Good Reasons  Increased capacity to express ideas. The depth at which we can think is influenced by the expressive power of the language in which we communicate our thoughts. Example: If you have weak grasp of your natural language, you are limited in the complexity of your thinking, particularly in the area of abstraction.  Improved background for choosing appropriate languages. Make better informed choices if you are familiar with other available languages, especially the particular features of those languages. _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 14 More Good Reasons, cont’d  Increased capacity to learn new languages. A thorough understanding of the fundamental concepts of languages makes it easier to see how those concepts are incorporated into the design of the new languages. Learning a new language gives you better understanding of your first language.  Better understanding language implementation. Understand implementation issues  Understand why languages are designed the way they are  Ability to use a language more intelligently.  Increased ability to design new languages. Advance the state of the art. Better languages can crowd out poor languages.

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 15 A Historic Timeline Programming Languages: Principles and Practice, 3 rd ed. Kenneth Louden & Kenneth Lambert (c) 2012 Course Technology. All rights reserved

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 16 Origins of Programming Languages  A programming language is often defined as “a notation for communicating to a computer what we want it to do”.  Before the mid 1940s, computer operators set switches to adjust the internal wiring of a computer to perform the requested tasks.  Programming languages allowed computer users to solve problems without having to reconfigure hardware. _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 17 Plugboard Control Panel IBM 407 Accounting Machine (1949)

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 18 Programming a Plugboard “Hmm, should I pass this parameter by value or by reference?”  “Programming” was hand-wiring plugboards.

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 19 Programming a Plugboard  Plugboard wiring diagram It doesn’t look too complicated, does it?

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 20 Machine Language  John von Neumann proposed that computers should be permanently hardwired with a small set of general-purpose operations. An operator could input a series of binary codes to organize the basic hardware operations to solve more specific problems. Operators could flip switches to enter these codes, called machine language, into memory. _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 21 Machine Language  Machine language programming was tedious and error prone.

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 22 Assembly Language  Assembly language: a set of mnemonic symbols for instruction codes and memory locations. Example: LD R1,R2  Assembler: a program that translates the symbolic assembly language code to binary machine code.  Loader: a program that loads the machine code into computer memory for execution.  Input devices: Keypunch machine Punched card reader _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 23 IBM 1401 Autocoder Programming  80/80 List Read and print a deck of cards. JOB 80/80 CARD LISTER * ORG 333 LOCATE AFTER THE PRINT AREA START CS 332 CLEAR STORAGE CS CLEAR STORAGE SW 1,201 SET WORD MARKS AT 1 AND 201 * READ R READ A CARD INTO READ AREA MCW 80,280 MOVE TO PRINT AREA W PRINT IT BLC DONE GO TO DONE IF LAST CARD READ B READ ELSE GO READ ANOTHER CARD * DONE H DONE ALL DONE END START MCW Move characters to word mark Main loop

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 24 Assembly Language  Mnemonic symbols were an improvement over binary machine codes but still had shortcomings. Lacks abstraction of conventional mathematical notation. Each type of computer hardware architecture has its own machine language instruction set and requires its own dialect of assembly language.  Assembly languages first appeared in the 1950s and are still used today for low-level system tools or for hand-optimization. _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 25 Punched Cards  Data was stored in punched cards called “IBM cards” or “Hollerith cards” Named after Herman Hollerith.  80 columns per card, one character per column.  Up to 12 punched holes per column.  Alphanumeric data, often grouped into fields. _

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 26 A Data Processing Job  A typical “job”. Tanenbaum & Woodhull Operating Systems: Design and Implementation (c) 2006 Prentice-Hall, Inc. All rights reserved

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 27 Punched Cards  Data processing was all about punched cards.  My school compiler project: 3½ boxes of punched cards Each box = 2000 cards, 10 lbs.

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 28 FORTRAN  FORTRAN: FORmula TRANslation language Developed by John Backus in the early 1950s. Reflected the architecture of a particular type of machine. Lacked the structured control statements and data structures of later high-level languages.  Popular with scientists and engineers for its support for algebraic notation and floating-point numbers.  The language has evolved and is still used today. FORTRAN IV FORTRAN 77 FORTRAN 90 FORTRAN 95 FORTRAN

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 29 FORTRAN DOUBLE PRECISION NUMBER, ROOT C DO 500 I = 1, 3 C 5 WRITE (6, 10) 10 FORMAT ('ENTER A NUMBER') C READ (5,100) NUMBER 100 FORMAT (F5.1) C IF (NUMBER.GE. 0.0) GO TO 175 WRITE (6, 150) 150 FORMAT ('*** THE NUMBER MUST NOT BE NEGATIVE.') GOTO 5 C 175 ROOT = DSQRT(NUMBER) C WRITE (6,200) NUMBER, ROOT 200 FORMAT ('THE SQUARE ROOT OF ', F5.1, ' IS ', F15.10) C 500 CONTINUE C PAUSE STOP END Demo What does this FORTRAN IV program do?

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 30 Algol  Algol: Algorithmic Language released in 1960 Provided a standard notation for computer scientists to publish algorithms in journals. John Backus was a major contributor.  Structured control statements Sequencing (begin-end blocks) Loops (for loop) Selection (if and if-else statements)  Different numeric types  Introduced the array structure  Supported procedures Including recursive procedures

SJSU Dept. of Computer Science Spring 2014: January 27 CS 152: Programming Language Paradigms © R. Mak 31 The Algol Family  A large number of high-level languages descended from Algol, including: Pascal: language for teaching programming in the 1980s Ada: for embedded applications of U.S. Dept. of Defense  Algol control structures are present in today’s languages, including Java, C, C++, etc. _