CSE 307: Principles of Programming Languages



Similar documents
Lecture 1: Introduction

CSCI 3136 Principles of Programming Languages

Programming Languages

CSC Software II: Principles of Programming Languages

Announcements FORTRAN ALGOL COBOL. Simula & Smalltalk. Programming Languages

CSE 130 Programming Language Principles & Paradigms

Fundamentals of Programming Languages

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

n Introduction n Art of programming language design n Programming language spectrum n Why study programming languages? n Overview of compilation

Languages september 12, 2015 Éric Lévénez < FORTRAN III end-1958 FORTRAN II FORTRAN I october 1956

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

Language Evaluation Criteria. Evaluation Criteria: Readability. Evaluation Criteria: Writability. ICOM 4036 Programming Languages

1.1 WHAT IS A PROGRAMMING LANGUAGE?

Principles of Programming Languages Topic: Introduction Professor Louis Steinberg

Functional Programming

Programming Languages

What is a programming language?

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)

Semester Review. CSC 301, Fall 2015

Course Goal CMSC 330: Organization of Programming Languages. Studying Programming Languages. All Languages Are (Kind of) Equivalent.

Image credits:

1/20/2016 INTRODUCTION

Asogwa Tochukwu Chijindu Department of Computer Engineering, Enugu State University of Science and Technology(ESUT), Enugu, Nigeria.

How To Understand Programming Languages And Programming Languages

McGraw-Hill The McGraw-Hill Companies, Inc.,

CS 40 Computing for the Web

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science

CS 51 Intro to CS. Art Lee. September 2, 2014

ATSBA: Advanced Technologies Supporting Business Areas. Programming with Java. 1 Overview and Introduction

COS 301 Programming Languages

Fall 2012 Q530. Programming for Cognitive Science

Chapter 13: Program Development and Programming Languages

Chapter 6: Programming Languages

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

Chapter 5 Names, Bindings, Type Checking, and Scopes

Do general-purpose programming languages have a future?

Programming language concepts

The C Programming Language course syllabus associate level

Chapter 14. Programming and Languages. McGraw-Hill/Irwin. Copyright 2008 by The McGraw-Hill Companies, Inc. All rights reserved.

Computer Programming. Course Details An Introduction to Computational Tools. Prof. Mauro Gaspari:

Computer Programming I

Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding

Evolution of the Major Programming Languages

Programming and Software Development CTAG Alignments

History OOP languages Year Language 1967 Simula Smalltalk

THE ROLE OF PROGRAMMING PARADIGMS IN THE FIRST PROGRAMMING COURSES. 1. Introduction

Chapter 15 Functional Programming Languages

Compilers. Introduction to Compilers. Lecture 1. Spring term. Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam.

CS 6371: Advanced Programming Languages

CSCI 528: OBJECT ORIENTED PROGRAMMING, Fall 2015

Understanding Programming Languages

Concepts of Programming Languages: A Unified Approach. Karl Abrahamson

02-201: Programming for Scientists

Chapter 12 Programming Concepts and Languages

Functional Programming. Functional Programming Languages. Chapter 14. Introduction

Syllabus INFO-UB Design and Development of Web and Mobile Applications (Especially for Start Ups)

Web Application Development

COS 333: Advanced Programming Techniques

CS 106 Introduction to Computer Science I

Sample Syllabus (C++) CSCI 1301 Introduction to Programming Principles

Ed. v1.0 PROGRAMMING LANGUAGES WORKING PAPER DRAFT PROGRAMMING LANGUAGES. Ed. v1.0

Welcome to Introduction to Computers and Programming Course using Python

DEGREE PLAN INSTRUCTIONS FOR COMPUTER ENGINEERING

Static vs. Dynamic. Lecture 10: Static Semantics Overview 1. Typical Semantic Errors: Java, C++ Typical Tasks of the Semantic Analyzer

AUTOMATIC EVALUATION OF COMPUTER PROGRAMS USING MOODLE S VIRTUAL PROGRAMMING LAB (VPL) PLUG- IN

Introduction to Software Paradigms & Procedural Programming Paradigm

CS422 - Programming Language Design

CSCE 314 Programming Languages

Chapter 13: Program Development and Programming Languages

Evolution of the Major Programming Languages

The Evolution of Programming Languages

Programming Language Rankings. Lecture 15: Type Inference, polymorphism & Type Classes. Top Combined. Tiobe Index. CSC 131! Fall, 2014!

Software Paradigms (Lesson 1) Introduction & Procedural Programming Paradigm

Programming Language Pragmatics

History of Programming Languages

Moving from CS 61A Scheme to CS 61B Java

Programming Languages

Fundamentals of Java Programming

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Instructor Özgür ZEYDAN BEU Dept. of Enve. Eng. CIV 112 Computer Programming Lecture Notes (1)

CMSC Fundamentals of Computer Programming II (C++)

Syllabus INFO-GB Design and Development of Web and Mobile Applications (Especially for Start Ups)

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

Programming Languages & Tools

CS 261 C and Assembly Language Programming. Course Syllabus

Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages

Programming Language Concepts for Software Developers

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Monfort College of Business Semester Course Syllabus ( )

Parameter passing in LISP

COURSE SYLLABUS EDG 6931: Designing Integrated Media Environments 2 Educational Technology Program University of Florida

COS 217: Introduction to Programming Systems

Transcription:

Course Organization Introduction CSE 307: Principles of Programming Languages Spring 2015 R. Sekar Course Organization Introduction 1 / 34 Topics 1. Course Organization Info and Support Course Description Text Grading Cheating 2. Introduction Languages and Characteristics Paradigms History Design Criteria 2 / 34 Section 1 Course Organization 3 / 34

Course information sources Course web page: http://seclab.cs.sunysb.edu/sekar/cse307/ (Redirected from http://www.cs.sunysb.edu/~cse307/) Used for general information about the course Instructor and TA information Office hours Lecture notes Blackboard: Will be used for announcements, emails, assignment submissions, posting grades, etc. 4 / 34 Course Support Check the course web pages and Blackboard announcements. Follow the discussion forum for the course on Blackboard. Post your questions relating to homeworks (or any other topic discussed in class) on this forum. But check the course web page and previous forum postings before making a new one, as the question may have already been answered. Do not use email except for questions of personal nature. Come to my office hours or that of the TAs. Grading related questions: send email to the TA who graded your homework. 5 / 34 Course Objectives Develop a fundamental understanding of programming language concepts. Acquire tools to choose, use, evaluate and design programming languages. Learn different flavors of programming languages. 6 / 34

What will you learn in CSE 307? Programming Language Concepts Values, Binding, Scopes, Naming,... Programming Paradigms Object-oriented, Functional, Logic Runtime environments, Interpreters and Compilers 7 / 34 Programming Languages Covered Imperative: C, [Pascal] Object-oriented: C++, Javascript, Java Functional: OCAML, Use of functional style in Python, [Haskell] Logic: Prolog 8 / 34 Textbooks Required: Kenneth C. Louden, Programing Languages Principles and Practice, Second Edition, Thomson Publishers. You can buy the 3rd edition if you cannot find the 2nd edition But I find used versions of the second edition on Amazon for $1 or so! 9 / 34

How the course is run Approximately one homework every two weeks Non-programming homeworks about programming language concepts. Short programming assignments to learn programming in new languages. Larger (around 500 lines) programming assignments: writing interpreters to solidify the understanding programming language concepts. You can skip or drop one assignment in the whole semester Grading (approximate) 70% exams: Two midterms (15% to 18% each) plus Final (approx. 35%) 30% homeworks, assignments, quizzes and class participation. To receive a good grade, you must do well individually in each component 10 / 34 Academic Integrity Do not copy from any one, or any source (on the Internet or elsewhere) The penalty for cheating is an F-grade, plus referral to graduate school. No exception, regardless of the amount of copying involved. In addition, if you cheat, you will be unprepared for the exams, and will do poorly. To encourage you to work on your own, we scale up assignment scores by about 10% to 25% 11 / 34 Section 2 Introduction 12 / 34

Language The words, their pronunciation, and the methods of combining them used and understood by a community. A formal system of signs and symbols including rules for the formation and transformation of admissible expressions Merriam-Webster Dictionary Programming Language: (from the textbook) A notation for describing computation in machine-readable and human-readable form 13 / 34 Programming Languages Low-level languages e.g. assembly languages closer to the level of the machine High-level languages e.g. Java closer to the level of the human programmer Special-purpose languages e.g. SQL Tailored for use in a particular setting... in constrast to general purpose languages 14 / 34 Characteristics of programming languages Human Readability: Use of abstractions... to move the programmer from the domain of the machine to the domain of the problem being solved Different languages differ in the abstractions they facilitate Machine Readability: Recognizers (syntax checkers) Compilers and interpreters 15 / 34

Data Abstraction Basic Data Abstraction: Common, atomic data values such as integers; places to store such values (e.g. variables ); notation to indicate the association between places, their names and values. Structured Data Abstraction: Group or collection of related data values e.g. arrays, records, etc. Unit Data Abstraction: Encapsulating related data values and structures into induvidual program units e.g. modules and packages. Control Abstraction 16 / 34 Basic Control Abstraction: Most fundamental of control (e.g. data movement) Statements (e.g. x = x + 1) Structured Control Abstraction: Combine basic controls into more powerful groups Control structures such as if, while, case/switch etc. Abstraction of a group (sequence) of actions into a single action (e.g. procedures and methods) Unit Control Abstraction: Same as in data abstraction: packages and modules The study of languages 17 / 34 Language Definition Syntax (structure) Semantics (meaning) Language Features Control structures Data structures Extensions Language Processing Translation Interpretation Runtime environment Language Design Understandability Simplicity and Expressiveness Efficiency Portability Security/Error-checking 18 / 34

Language Paradigms Procedural: Fortran, Algol, PL-1, Pascal, C,... Object-oriented: Simula67, Smalltalk, Ada, Modula-3, C++, Java,... Functional: LISP, ISWIM, Scheme, FP, ML, Haskell, Gofer,... Logic: Prolog, SetL, CLP, Mercury,... Scripting / Domain-Specific: sh, AWK, Perl, Tcl/Tk, Postscript, JavaScript,... 19 / 34 The more familiar paradigms Imperative/procedural languages Programs are written with Control as the key element. Languages simply abstract the operational aspects of a machine. e.g. Pascal, C, Algol. Object-oriented languages Programs are written with Data (objects) as the key element. Languages provide mechanisms to associate operations with specific data values (methods) e.g. C++, Java. 20 / 34 Less familiar paradigms Functional languages Programs are written with focus on operations (functions) on data values Functions combined using composition, evaluated at particular values using application. Usually have no notion of assignments let rec gcd m n = let r = m mod n in if r = 0 then n else gcd n r 21 / 34

Even less familiar paradigms Logic languages Programs weitten with focus on relationships between data values. Programs specify what must be true about a problem s solution; the programming system takes care of achieving the specifications. Declarative programming mother(mary, joe). parent(p, C) :- mother(p, C). father(sam, joe). parent(p, C) :- father(p, C). mother(jane, sam). father(rob, sam). ancestor(a, D) :- parent(a, D).... ancestor(a, D) :- parent(a, C), ancestor(c, D). 22 / 34 History of Programming Languages (1) 1940s: Programming by wiring, machine languages, assembly languages 1950s: FORTRAN, COBOL, LISP, APL 1960s: PL/I, Algol68, SNOBOL, Simula67, BASIC 1970s: Pascal, C, SML, Scheme, Smalltalk 1980s: Ada, Modula 2, Prolog, C++, Eiffel 1990s: Java, Haskell 2000s: Javascript, PHP, Python,... 23 / 34 History of Programming Languages (2) FORTRAN: the grandfather of high-level languages Emphasis on scientific computing Simple data structures (arrays) Control structures (goto, do-loops, subroutines) ALGOL: where most modern language concepts were first developed Free-form syntax Block-structure Type declarations Recursion 24 / 34

History of Programming Languages (3) LISP: List-processing language Focus on non-numeric (symbolic) computation Lists as a universal data structure Polymorphism Automatic memory management Mother of modern functional languages Descedants include Scheme, Standard ML and Haskell Some of these languages have greatly influenced more recent languages such as Python, Javascript, and Scala 25 / 34 History of Programming Languages (4) Simula 67: Prolog: Object orientation (classes/instances) Precursor of all modern OO-languages Smalltalk C++ Java Back-tracking Unification/logic variables 26 / 34 History of Programming Languages (5) C: High-level assembly language Simplicity Low-level control that enables OSes to be implemented mostly in C Registers and I/O Memory management Support for interspersing assembly code Java: A simple, cleaner alternative to C++ Reliability: Robustness/Security built from ground-up Internet focused: write once, run every where Bundled with runtime libraries providing rich functionality Draws on some concepts from functional languages 27 / 34

Programming Language Design The primary purpose of a programming language is to support the construction of reliable (and efficient) software Language Design Criteria: Efficiency was the singular focus in the early days (1940s and 1950s). Readability Complexity Reliability Expressiveness Maintainability Portability Expressiveness 28 / 34 Ability to write programs focussing on the problem, not on the machine used to solve it. Ability to express complex processes and structures. Support for data and control abstraction Expressiveness conciseness! e.g. while (*s++ = *t++); 29 / 34 Simplicity and Extensibility Simplicity: ability to express programs concisely, in a manner that is easy to write, read, and understand. Simplicity of learning vs. simplicity of programming vs. simplicity of understanding Small set of basic concepts Constructs can be expressed and used only in one way. Extensibility: ability to add new features to the language Data type definition in Pascal, Modula, Ada,... Definition of new operators (or reuse existing operators such as + ) in SML, Prolog, Haskell,... 30 / 34

Regularity Generality: Operations/constructs available for all closely related cases: in C: Compare two integers with == but not two structures/arrays in Java: Can make collections of objects (e.g. Integer) but not primitive values (e.g. int) Orthogonality: Constructs can be combined in a meaningful way: in C: All parameters are passed by value except arrays in Java: A class can have static members but an abstract class cannot. Uniformity: Constructs appear and behave consistently: in C, Java: = means assignment while == is a comparison. Law of least astonishment Efficiency 31 / 34 Efficiency of executable code Efficiency of translation Efficiency of programming Reusabilty Reliability Security Maintainability Consistency, Precision and Security 32 / 34 Use of accepted notations and notions DO 9 I = 1, 10 DO 9 I = 1. 10 Availability of well-specified standards When is int same as long? short? Are structures byte aligned? or word aligned? Constructs to build programs that cannot be subverted Array bounds checks Safety in types 33 / 34

Error Detection and Correction Catch programming errors at compile-time Strong type system Memory safety Constructs to handle usage errors Exception handling mechanism Mechanisms to test and uncover errors Reflection... 34 / 34